-
Notifications
You must be signed in to change notification settings - Fork 2
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 #18 from seawolf42/feature/choose-between-name-and…
…-id-in-serializer Feature/choose between name and id in serializer
- Loading branch information
Showing
6 changed files
with
47 additions
and
14 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,5 +1,20 @@ | ||
import os | ||
import sys | ||
|
||
from django.conf import settings | ||
|
||
_SETTINGS = getattr(settings, 'LOOKUP_TABLES', {}) | ||
|
||
USE_ADMIN_SORTABLE2 = _SETTINGS.get('USE_ADMIN_SORTABLE2', False) | ||
DRF_REPRESENTATION_NAME_NOT_ID = _SETTINGS.get('DRF_REPRESENTATION_NAME_NOT_ID', False) | ||
|
||
_IGNORE_INIT_RESET_KEY = 'LOOKUP_TABLES_DRF_FIELD_INIT_NO_RESET' | ||
|
||
if _IGNORE_INIT_RESET_KEY in os.environ: | ||
IGNORE_INIT_RESET = os.environ[_IGNORE_INIT_RESET_KEY].lower() in ('1', 'true') | ||
elif len(sys.argv) > 1 and sys.argv[0].endswith('manage.py') and sys.argv[1] != 'runserver': | ||
IGNORE_INIT_RESET = True | ||
else: | ||
IGNORE_INIT_RESET = False | ||
|
||
del _IGNORE_INIT_RESET_KEY |
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