Commit Graph

299 Commits

Author SHA1 Message Date
Toni
5d69628250 Update rest_framework/serializers.py
fixed AttributeError in case restore_object is overwritten without explicitly setting self.m2m_data
2012-11-05 20:55:03 +01:00
Tom Christie
6d201c362f Drop unneccesarily lenient dictionary-containing-instances serialization. 2012-11-05 16:19:11 +00:00
Tom Christie
33be4b43b9 queryset argument is now optional on writable model fields. 2012-11-05 12:51:04 +00:00
Tom Christie
ccd5f29510 Tidy up serializer fields now we no longer use dynamic fields 2012-11-05 11:03:36 +00:00
Tom Christie
dfb8225447 Add note on * import 2012-11-05 10:56:30 +00:00
Tom Christie
b7b942c599 Swap position of instance and data keyword arguments. 2012-11-05 10:53:20 +00:00
Tom Christie
0047a46020 Merge fixes for 'blank=True' fields. Fixes #324, Fixes #325
Thanks to @Roarster.
2012-10-30 11:03:03 +00:00
Tom Christie
e5777a6168 Merge pull request #336 from markotibold/null_is_true_model_fields
Null is true model fields
2012-10-30 02:22:51 -07:00
Marko Tibold
4d90bb4af4 Fix some typos. 2012-10-30 00:30:52 +01:00
Marko Tibold
2068595297 Set a ModelSerializer field to required=False if the ModelField has null=True set. 2012-10-30 00:09:40 +01:00
Tom Christie
de6908fbef Remove recursion detection 2012-10-28 20:50:14 +00:00
Tom Christie
351382fe35 nested -> depth 2012-10-28 20:43:43 +00:00
Tom Christie
44207a347a pep8 2012-10-27 10:33:01 +01:00
Tom Christie
67f1265e49 Fix failing 'default' on ModelSerializer 2012-10-26 13:20:30 +01:00
Tom Christie
32d602880f Choice fields from ModelSerializer. 2012-10-26 12:45:52 +01:00
Tom Christie
3e751ccd8a Fix ModelSerializer logic for fields with default value, which should have required=False set 2012-10-24 20:58:28 +01:00
Jamie Matthews
607c31c6d8 Move per-field and cross-field validation into a single method 2012-10-24 12:12:27 +01:00
Jamie Matthews
d60d598e02 Clean up internal names and documentation 2012-10-24 11:43:30 +01:00
Jamie Matthews
ac2d39892d Add cross-field validate method 2012-10-24 11:39:17 +01:00
Jamie Matthews
388a807f64 Switch from clean_<fieldname> to validate_<fieldname>, clarify documentation 2012-10-24 11:27:01 +01:00
Jamie Matthews
51fae73f3d Implement per-field validation on Serializers 2012-10-24 09:28:10 +01:00
Jamie Matthews
45d4622f09 Fix serialization of reverse relationships 2012-10-22 15:12:25 +01:00
Rob Dobson
38673c35d4 Make default field check safe for boolean values whereby 'False' may be an acceptable default value 2012-10-17 19:12:34 +01:00
Jens Alm
c942726509 Added docs, integer fields and refactored models.TextField to use CharField
I realized that per the django forms, there is no need for a separate
TextField, an unlimited CharField is perfectly good.
Also added default field for the different IntegerField types
2012-10-15 13:46:44 +02:00
Jens Alm
36cc56bc9d Added tests for TextField 2012-10-15 10:06:50 +02:00
Jens Alm
241be38340 Added TextField to recognized fields 2012-10-15 09:14:01 +02:00
Tom Christie
83f39b3dce Don't fail when no data provided 2012-10-10 16:41:08 +01:00
Tom Christie
a3ab66eca4 Add 'to_many' flag in get_related_field 2012-10-09 17:51:32 +01:00
Tom Christie
9bbc1cc403 Add flag in get_related_field 2012-10-09 17:49:04 +01:00
Tom Christie
65f592866c Fix issue where required fields were not being properly validated. Also make model fields with a default value be not required 2012-10-08 17:53:18 +01:00
Tom Christie
52ba2e3333 Fix #285 2012-10-08 12:52:56 +01:00
Tom Christie
c91d926b06 Initial tests for hyperlinked relationships 2012-10-04 16:58:18 +01:00
Tom Christie
aac6b6cf4e Tweak comment 2012-10-04 15:00:23 +01:00
Tom Christie
3a06dde884 Clean up field classes 2012-10-04 13:28:14 +01:00
Tom Christie
d89d6887d2 HyperlinkedModelSerializer with working HyperlinkedIdentityField, but no hyperlinked relations 2012-10-04 11:26:41 +01:00
Tom Christie
a366d6e612 M2M fields supported 2012-10-03 16:08:20 +01:00
Tom Christie
58c1263267 Use either PrimaryKeyRelatedField or ManyPrimaryKeyRelatedField as appropriate (fixes test) 2012-10-03 12:16:30 +01:00
Tom Christie
7c303411a9 Add Serializer.save() to clean up differences between serializer.object being either a DeserializedObject or a model instance 2012-10-03 11:08:02 +01:00
Tom Christie
1a05942166 Stopgap fix for model fields rendering in browseable API 2012-10-03 09:45:27 +01:00
Tom Christie
c30e0795be Rename generic views 2012-10-03 09:26:15 +01:00
Tom Christie
d1b99f350a Added model form field -> serializer form field mapping 2012-10-02 16:16:49 +01:00
Tom Christie
ab173fd8f9 Fix bug where pk could be set in post data 2012-10-02 15:37:13 +01:00
Tom Christie
b16fb57771 Expand pagination support, add docs 2012-10-01 15:49:19 +01:00
Tom Christie
9f71f8e618 Fix broken bits of generic views 2012-09-28 15:54:00 +01:00
Tom Christie
4ebd701be7 Fix serialization issue with Django 1.3 2012-09-28 14:53:22 +01:00
Tom Christie
e003cc91b6 Get test-only models properly working 2012-09-28 14:28:50 +01:00
Tom Christie
e0913e29b8 Fix some bits of serialization 2012-09-25 13:20:12 +01:00
Tom Christie
d9cba6398e Clean up bits of templates etc 2012-09-20 17:44:34 +01:00
Tom Christie
4b691c4027 Change package name: djangorestframework -> rest_framework 2012-09-20 13:06:27 +01:00