Jamie Matthews
68c397371c
Fix related serializers with source argument that resolves to a callable
2012-11-20 09:41:36 +00:00
Tom Christie
e801e21210
Merge pull request #422 from markotibold/max_length_for_modelserializers
...
Max length for modelserializers
2012-11-16 14:54:16 -08:00
Marko Tibold
1a436dd6d9
Added URLField and SlugField.
...
Fixed test_modelserializer_max_length_exceeded
2012-11-16 22:43:16 +01:00
Marko Tibold
f385b72d80
Whoops … Drop pdb
2012-11-16 22:20:26 +01:00
Marko Tibold
aa013a4289
Fixes #421
2012-11-16 22:18:57 +01:00
Marko Tibold
403886b79b
Merge commit '3b258d69c92e9d9293f7c5d1690f0ca434e677e3' into file_and_image_fields
2012-11-15 22:48:22 +01:00
Marko Tibold
c35b9eb065
Processed review comments.
...
No type checking in .restore_fields()
Added missing BytesIO import.
2012-11-14 21:13:23 +01:00
Stephan Groß
44ff2e0add
fixed some typos
2012-11-14 19:36:29 +01:00
Marko Tibold
5443dd5f3c
Added a FileField and an ImageField (copied from django.forms.fields).
...
Adjusted generics, mixins and serializers to take a `files` arg where applicable.
2012-11-13 23:26:17 +01:00
Tom Christie
21468a1867
Fix broken depth argument
2012-11-13 11:47:32 +00:00
Tom Christie
e224061189
Support for read_only_fields
on ModelSerializer
classes
2012-11-09 17:01:20 +00:00
Tomi Pajunen
40c6fe7119
Comments updated
2012-11-08 17:04:29 +02:00
Tomi Pajunen
743224d000
Fixed creation of objects with reversed M2M relations
2012-11-08 16:31:16 +02:00
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