Commit Graph

130 Commits

Author SHA1 Message Date
Tom Christie
b052c92ac3 Cleanup imports
Mostly adding `from __future__ import unicode_literals` everywhere.
2013-02-04 20:55:35 +00:00
Tom Christie
8e846bdf52 Merge branch 'py3k' into 2.2
Conflicts:
	rest_framework/relations.py
	rest_framework/serializers.py
	rest_framework/tests/relations_hyperlink.py
	rest_framework/tests/relations_slug.py
2013-02-04 20:37:09 +00:00
Tom Christie
f4f237e3ee 3.2, 3.3 compat 2013-02-01 14:03:28 +00:00
Tom Christie
d9c7b1c585 Merge branch 'p3k' of https://github.com/linovia/django-rest-framework into working
Conflicts:
	rest_framework/authentication.py
	rest_framework/relations.py
	rest_framework/serializers.py
	rest_framework/settings.py
	rest_framework/tests/authentication.py
	rest_framework/tests/genericrelations.py
	rest_framework/tests/generics.py
	rest_framework/tests/relations_hyperlink.py
	rest_framework/tests/relations_nested.py
	rest_framework/tests/relations_pk.py
	rest_framework/tests/serializer.py
2013-02-01 11:58:55 +00:00
Tom Christie
d9b73e15c8 Serializers take many=<bool> argument. 2013-01-31 17:06:23 +00:00
Tom Christie
f1e665673f Tidying 2013-01-30 20:38:11 +00:00
Tom Christie
be6df3ae3c Merge branch 'master' into many-fields
Conflicts:
	rest_framework/relations.py
2013-01-30 13:41:56 +00:00
Andrea de Marco
85e6360792 Update rest_framework/serializers.py 2013-01-28 22:08:40 +01:00
Tom Christie
a3a06d11cc Ensure model field validation is performed for ModelSerializers with a custom restore_object method. Fixes #623. 2013-01-28 12:56:42 +00:00
Tom Christie
a51bca32fd Fix issues with custom pagination serializers 2013-01-26 20:54:41 +00:00
Tom Christie
b41f258ee5 Serializers should accept source='*' argument. Fixes #604.
(Test also incoming)
2013-01-26 20:54:03 +00:00
Stephan Groß
69e62457ef Improve validate_<fieldname> fix 2013-01-23 07:53:54 +01:00
Stephan Groß
2250ab6418 Add possible solution for field validation error 2013-01-21 12:50:39 +01:00
Tom Christie
6385ac519d Revert accidental merge. 2013-01-18 19:47:57 +00:00
Mark Aaron Shirley
221f7326c7 Use None to delete nested object as opposed to _delete flag 2013-01-16 16:04:20 -08:00
Mark Aaron Shirley
34e14b01e4 Move nested serializer logic into .field_from_native() 2013-01-16 16:04:20 -08:00
Mark Aaron Shirley
2d62bcd5aa Add one-to-one nested update and delete functionality 2013-01-16 16:04:20 -08:00
Mark Aaron Shirley
72c04d570d Add nested create for 1to1 reverse relationships 2013-01-16 16:04:19 -08:00
Tom Christie
d9acec3e6d PK fields should only be read-only if they are an AutoField. Fixes #563 2013-01-12 09:43:14 +00:00
Tom Christie
73c4e5c460 auto_now and auto_now_add fields should be read only by default 2013-01-12 09:43:14 +00:00
Mark Aaron Shirley
81691ff900 Merge remote-tracking branch 'upstream/master' into null-one-to-one 2013-01-08 08:33:01 -08:00
Tom Christie
4bb504732d Respect blank=True on relational fields. Fixes #537 2013-01-07 21:08:55 +00:00
Mark Aaron Shirley
213981cef3 Handle ObjectDoesNotExist exceptions when serializing null reverse one-to-one 2013-01-04 21:11:03 +01:00
Tom Christie
26f9acb45a Validation errors instead of exceptions when serializers receive incorrect types. Fixes #402. 2013-01-04 14:11:05 +00:00
Tom Christie
92ae08207a Drop unused private save_m2m flag 2013-01-03 21:49:01 +00:00
Xavier Ordoquy
60250f22c8 Move the various compat things to the compat module. 2013-01-03 11:41:07 +01:00
Xavier Ordoquy
c95fa81cb2 Use new exception style 2013-01-02 19:06:28 +01:00
Xavier Ordoquy
737349d238 Merge remote-tracking branch 'reference/py3k' into p3k 2013-01-02 16:09:21 +01:00
Mark Aaron Shirley
a617a3758f Don't persist relation changes in ModelSerializer#restore_object() 2012-12-31 14:33:24 +01:00
Tom Christie
8fad0a727a Relation fields move into relations.py 2012-12-31 08:53:40 +00:00
Tom Christie
caaf1c80f5 Support reverse FK creation 2012-12-29 16:51:41 +00:00
Tom Christie
809f5de330 Merge pull request #515 from yprez/blank_fields_issue
Fix for #514
2012-12-29 05:25:43 -08:00
Tom Christie
923f81d269 Nested serializers now support nullable relationships, plus test. Fixes #384 2012-12-29 13:19:05 +00:00
Tom Christie
6693d2d277 Fix for pks returning as strings when set in pre_save. Fixes #482. Thanks to @n8agrin for the bug report. 2012-12-18 18:21:58 +00:00
Tom Christie
aa72f8d63d Fix bug with M2M in browseable API 2012-12-17 21:59:51 +00:00
Yuri Prezument
c68f7ca580 blank=True fields are not required - fixes #514 2012-12-17 16:57:11 +02:00
toran billups
008dafce17 ManyPrimaryKeyRelatedField now supports create for one-to-many rel 2012-12-15 20:55:36 -06:00
Tom Christie
35f72cecb1 Fix model validation exclusions. Fixes #500. Fixes #506. 2012-12-15 20:40:41 +00:00
Tom Christie
39b01d6802 Ensure context is passed to dynamically added fields. Fixes #476. 2012-12-14 19:59:29 +00:00
Tom Christie
497da7fc69 Clean up field initialization. Fixes #497 2012-12-12 20:45:06 +00:00
Tom Christie
85bf4164dd Drop left over code 2012-12-11 22:09:04 +00:00
Tom Christie
4058223309 Fix broken nested fields 2012-12-11 21:07:25 +00:00
Marko Tibold
d0935d1fbb get_excluded_fieldnames() should respect Meta options' ability to be either a tuple or list. Fixes #490.
Refactored `if self.opt.fields` out of the for loop.
Updated and cleaned up the validation-tests.
2012-12-10 23:10:04 +01:00
Tom Christie
ac2720afcb Add null related field option 2012-12-08 13:00:49 +00:00
Tom Christie
303bc7cf95 Support nullable FKs, with blank=True 2012-12-07 21:32:45 +00:00
Tom Christie
a5178e9a36 Merge pull request #451 from markotibold/#431
Call model's .full_clean() method, eg. to validate uniqueness
2012-12-07 12:34:56 -08:00
Marko Tibold
919aff329e Fix AttributeError caused by accessing a non-existing default_keys attribute. 2012-12-07 00:08:27 +01:00
Tom Christie
6ffcd7ba36 Merge pull request #477 from roberts81/master
Fix for #460
2012-12-06 14:54:28 -08:00
Marko Tibold
c65f22e0e4 Merge branch 'master' of https://github.com/tomchristie/django-rest-framework into #431 2012-12-06 23:47:47 +01:00
Ben Roberts
cb7d9ea5c9 cleaned up white space & docstring styling 2012-12-06 12:45:50 -07:00