-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from theatlantic/pr/django-1.11-support
Support Django up to 1.11, fix DeprecationWarnings, fixes #89
- Loading branch information
Showing
19 changed files
with
246 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.db import models | ||
try: | ||
from django.urls import reverse | ||
except ImportError: | ||
from django.core.urlresolvers import reverse | ||
from django.utils.encoding import python_2_unicode_compatible | ||
from sortedm2m.fields import SortedManyToManyField | ||
|
||
|
||
@python_2_unicode_compatible | ||
class Car(models.Model): | ||
plate = models.CharField(max_length=50) | ||
|
||
def __unicode__(self): | ||
def __str__(self): | ||
return self.plate | ||
|
||
|
||
@python_2_unicode_compatible | ||
class ParkingArea(models.Model): | ||
name = models.CharField(max_length=50) | ||
cars = SortedManyToManyField(Car) | ||
|
||
def __unicode__(self): | ||
def __str__(self): | ||
return self.name | ||
|
||
@models.permalink | ||
def get_absolute_url(self): | ||
return 'parkingarea', (self.pk,), {} | ||
return reverse('parkingarea', (self.pk,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.