-
Notifications
You must be signed in to change notification settings - Fork 23
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 #24 from sergei-maertens/feature/deconstructible_v…
…alidator Made the validator deconstructible in Django 1.7+, fixing #15
- Loading branch information
Showing
9 changed files
with
111 additions
and
33 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
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,4 +1,5 @@ | ||
from djchoices.choices import ChoiceItem, DjangoChoices, C | ||
|
||
__version__ = '1.4' | ||
|
||
__all__ = ["ChoiceItem", "DjangoChoices", "C"] |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Module to handle different Django/Python version libraries. | ||
""" | ||
try: | ||
from collections import OrderedDict | ||
except ImportError: # Py2.6, fall back to Django's implementation | ||
from django.utils.datastructures import SortedDict as OrderedDict # pragma: no cover | ||
|
||
|
||
try: | ||
from django.utils import six | ||
except ImportError: | ||
import six # pragma: no cover | ||
|
||
|
||
try: | ||
from django.utils.deconstruct import deconstructible | ||
except ImportError: | ||
# just return a noop decorator | ||
def deconstructible(cls): | ||
return cls |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import django | ||
|
||
|
||
def has_new_migrations(): | ||
return (django.VERSION[:2] >= (1, 7), "Test requires the Django migrations introduced in Django 1.7") |
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