-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make JSONField works properly with Django 1.9
- Loading branch information
Showing
3 changed files
with
115 additions
and
65 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django import VERSION | ||
|
||
|
||
if VERSION >= (1, 8): | ||
from itertools import chain | ||
|
||
def get_all_field_names_from_options(options): | ||
names = list(set(chain.from_iterable( | ||
(field.name, field.attname) if hasattr(field, 'attname') else (field.name,) | ||
for field in options.get_fields() | ||
))) | ||
return names | ||
else: | ||
def get_all_field_names_from_options(options): | ||
return options.get_all_field_names() |
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