Skip to content

Commit

Permalink
Merge branch 'master' into django0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
wgbbiao committed Jun 23, 2017
2 parents 97ed16d + 53d8520 commit 24bfb96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion xadmin/plugins/xversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def get(self, request, *args, **kwargs):

return TemplateResponse(
request, self.recover_list_template or self.get_template_list(
"views/recover_list.html"),
"views/recover_list.html"),
context)


Expand Down
5 changes: 3 additions & 2 deletions xadmin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from django.forms import Media
from django.utils.translation import get_language
from django.contrib.admin.utils import label_for_field, help_text_for_field
from django import VERSION as version
import datetime
import decimal

Expand All @@ -34,7 +35,7 @@
except ImportError:
from django.utils.timezone import localtime as tz_localtime

if django.get_version() < '1.11':
if django.VERSION < (1, 11):
DJANGO_11 = False
else:
DJANGO_11 = True
Expand Down Expand Up @@ -292,7 +293,7 @@ def lookup_field(name, obj, model_admin=None):
model_admin is not None
and hasattr(model_admin, name)
and name not in ('__str__', '__unicode__')
):
):
attr = getattr(model_admin, name)
value = attr(obj)
else:
Expand Down
2 changes: 1 addition & 1 deletion xadmin/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def __init__(self, request, *args, **kwargs):
self.request = request
self.request_method = request.method.lower()
self.user = request.user

self.base_plugins = [p(self) for p in getattr(self,
"plugin_classes", [])]

Expand Down
2 changes: 1 addition & 1 deletion xadmin/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, widgets, attrs=None):
def render(self, name, value, attrs=None):
if value is None:
value = ''
final_attrs = self.build_attrs(attrs, name=name)
final_attrs = self.build_attrs(attrs, {'name':name})
final_attrs['class'] = 'nav nav-pills nav-stacked'
output = [u'<ul%s>' % flatatt(final_attrs)]
options = self.render_options(force_text(value), final_attrs['id'])
Expand Down

0 comments on commit 24bfb96

Please sign in to comment.