Skip to content

Commit

Permalink
Merge pull request #1 from bertonha/fix-django-1.10
Browse files Browse the repository at this point in the history
Fix for Django 1.10
  • Loading branch information
pennersr authored Aug 16, 2016
2 parents 76f1d0b + 721ddaf commit df9a4b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: python
python: 2.7
env:
- TOX_ENV=py27
- TOX_ENV=py34
- TOX_ENV=py27-django19
- TOX_ENV=py34-django19
- TOX_ENV=py27-django110
- TOX_ENV=py34-django110
install:
- pip install tox
- pip install "coverage>=3.7.1" coveralls
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[tox]
distribute = False
envlist =
py27, py34
{py27,py34}-django19
{py27,py34}-django110


[testenv]
setenv = DJANGO_SETTINGS_MODULE=trackstats.tests.settings
usedevelop = True
deps =
Django
django19: Django==1.9.9
django110: Django==1.10
pytz
coverage
commands =
Expand Down
4 changes: 2 additions & 2 deletions trackstats/trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def track(self, qs):
timezone.get_current_timezone_name()
if settings.USE_TZ else None)

is_datetime = isinstance(qs.model._meta.get_field_by_name(
self.date_field)[0], models.DateTimeField)
is_datetime = isinstance(qs.model._meta.get_field(
self.date_field), models.DateTimeField)
if is_datetime:
date_sql, tz_params = connection.ops.datetime_cast_date_sql(
self.date_field,
Expand Down

0 comments on commit df9a4b4

Please sign in to comment.