Commit Graph

33 Commits

Author SHA1 Message Date
Viicos
d32346bae5
Fix type name of FieldInfo namedtuple (#9124)
* Fix type name of `FieldInfo` namedtuple

* Add test
2023-10-04 23:03:10 +06:00
suayip uzulmez
54307a4394
Replaced OrderedDict with dict (#8964) 2023-04-30 15:20:02 +06:00
Jon Dufresne
ff556a91fd Remove references to unsupported Django versions in docs and code (#5602)
Per the trove classifiers, DRF only supports Django versions 1.10+. Can
drop documentation, code comments, and workarounds for older Django
versions.
2017-11-20 09:35:54 +01:00
Carlton Gibson
c674687782 Remove Django 1.8 & 1.9 compatibility code (#5481)
* Identify code that needs to be pulled out of/removed from compat.py

* Extract modern code from get_names_and_managers in compat.py and remove compat code

* Extract modern code from is_authenticated() in compat.py and remove.

* Extract modern code from is_anonymous() in compat.py and remove

* Extract modern code from get_related_model() from compat.py and remove

* Extract modern code from value_from_object() in compat.py and remove

* Update postgres compat

JSONField now always available.

* Remove DecimalValidator compat

* Remove get_remote_field compat

* Remove template_render compat

Plus isort.

* Remove set_many compat

* Remove include compat
2017-10-05 20:41:38 +02:00
Mariusz Felisiak
40e3462767
Reverted "Removed multi-table inheritance auto created PK from serialize" 1ecbeebbe5. 2017-02-11 17:39:47 +01:00
Mariusz Felisiak
1ecbeebbe5 Fixed #4574 -- Removed multi-table inheritance auto created PK from serialize. (#4852) 2017-01-26 14:18:43 +00:00
Tom Christie
8d0a91b002 Fix 3674 (#4571)
Handle ModelSerializer case for relationships to models with custom pk.
2016-10-13 12:43:43 +01:00
Tom Christie
9c996d7d2a Clean up existing deprecation warnings. (#4166)
* Add Meta.fields = '__all__' to serializer classes where required.
* Add explicit on_delete=models.CASCADE to ForeignKey fields.
* Use '.remote_field' and '.model' in preference to '.rel' and '.to' when inspecting model fields.
* Use new value_from_object in preference to internal _get_val_from_obj
2016-06-02 14:39:10 +01:00
Karambir Singh Nain
69f1e3a9fd Remove old django checks from tests and compat
Remove skipping of tests for Django<1.8. Remove several functions from compat.py not needed for Django>=1.8
2016-02-19 01:47:45 +05:30
Andrei Fokau
2acc6a756c Use related_objects api for Django 1.9+ 2015-11-19 13:04:37 +01:00
Martin Hill
ff36cbe4ba same logic, more pythonic 2015-11-14 23:04:32 -05:00
Martin Hill
bac6f1fcf4 check if field.to_fields is None 2015-11-14 18:26:29 -05:00
Martin Hill
e475464945 fix for issue #3634 2015-11-14 17:00:07 -05:00
likeon
322bda8159 Added support for the to_field on ForeignKey fields 2015-10-21 15:33:18 +03:00
Carlton Gibson
45ace5010e Remove OrderedDict fallback 2015-09-22 16:35:38 +02:00
Carlton Gibson
6e86a53c92 Remove apps.get_model fallback
* Corrects presumed logic error in `ResolveModelWithPatchedDjangoTests`
2015-09-22 16:14:45 +02:00
Tom Christie
4f27697467 Fix get_model import 2015-08-27 17:28:12 +01:00
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
José Padilla
83c9136c90 Cleanup import following PEP 8 style guide 2015-06-25 16:10:17 -04:00
Ilias Kiourktsidis
0888f9cfc3 Use _meta instead of Meta on is_abstract_model function 2015-03-25 12:00:20 +00:00
Ilias Kiourktsidis
486f0a9367 Raise error when ModelSerializer used with abstract model 2015-03-23 15:01:19 +00:00
Tom Christie
dbd2352165 Fixes for latest pep8 updates. Refs #2563. 2015-02-17 10:58:00 +00:00
Tom Christie
39f26c9eca Merge master 2015-01-23 14:28:59 +00:00
Tom Christie
25a703b42c Work around meta API differences 2015-01-23 11:15:11 +00:00
Tom Christie
6168f60ba8 Merge branch 'master' into version-3.1 2015-01-05 11:02:28 +00:00
Kyle Valade
a7479721c8 First pass at refactoring get_field_info in utils.model_meta 2014-12-29 00:35:00 -08:00
Tom Christie
2a1485e009 Final bits of docs for ModelSerializer fields API 2014-12-19 21:32:43 +00:00
Tom Christie
3a5b3772fe Use ImproperlyConfigured when model meta lookup fails 2014-11-28 15:36:04 +00:00
Doug Beck
67735687b2 Ensure _resolve_model does not return None 2014-11-18 01:26:23 -05:00
Tom Christie
4e001dbb7a Drop usage of SortedDict. Closes #2027. 2014-11-06 12:00:30 +00:00
Tom Christie
14ae52a24e More gradual deprecation 2014-10-08 16:09:37 +01:00
Tom Christie
5b7e4af0d6 get_base_field() refactor 2014-09-18 11:20:56 +01:00
Tom Christie
40dc588a37 Drop label from serializer fields when not needed 2014-09-15 09:50:51 +01:00