Skip to content

Commit

Permalink
修改django版本判断
Browse files Browse the repository at this point in the history
  • Loading branch information
wgbbiao committed Jun 7, 2017
1 parent 862bee1 commit 7aec57c
Showing 1 changed file with 3 additions and 2 deletions.
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 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

0 comments on commit 7aec57c

Please sign in to comment.