Commit Graph

48 Commits

Author SHA1 Message Date
Yuri Prezument
745ebeca77 Handle case where obj=None in PKRelatedField.field_to_native()
Fixes #1072
2013-08-31 17:20:49 +03:00
Tom Christie
10d386ec6a Cleanup and dealing with empty form data. 2013-08-23 16:10:20 +01:00
Tom Christie
e03854ba6a Tweaks to display nested data in empty serializers 2013-08-23 14:06:14 +01:00
Tom Christie
c160e49321 Test cases and fix for plain-list relationships (ie not queryset) Closes #878. 2013-06-04 14:05:35 +01:00
Tom Christie
8b73dce51d view_name argument to HyperlinkedModelSerializer is now properly enforced. Closes #471 2013-06-02 19:50:24 +01:00
Tom Christie
d7753123f6 HyperlinkedModelSerializer lookup_field option should apply to HyperlinkedIdentityField 2013-05-31 11:50:37 +01:00
Tom Christie
c98ac3e83e Added get_url hook to HyperlinkedIdentityField in line with HyperlinedRelatedField. Closes #883 2013-05-29 14:09:31 +01:00
Tom Christie
22e1950e1c Backwards compatible approach to HyperlinkedIdentityField URLs. Closes #892 2013-05-28 12:08:36 +01:00
Tom Christie
e32a6e4211 Merge pull request #860 from andymckay/master
startswith can take a tuple
2013-05-18 07:17:13 -07:00
Andy McKay
aeba5bed05 startswith can take a tuple 2013-05-18 07:09:24 -07:00
Pablo Recio
392c8556ae Display an empty label into related fields if it isn't required 2013-05-18 15:01:58 +02:00
Craig de Stigter
c56d5f8f63 Merge remote-tracking branch 'upstream/master' 2013-05-18 10:23:26 +02:00
Andy Freeland
abe207b869 HyperlinkedIdentityField uses lookup_field kwarg.
According to the [Serializers API Guide][1], `HyperlinkedIdentityField`
takes `lookup_field` as a kwarg like the other related fields and the
generic views. However, this was not actually implemented.

[1]: http://django-rest-framework.org/api-guide/serializers.html#hyperlinkedmodelserializer
2013-05-16 11:48:35 -04:00
Tom Christie
538d2e35e7 lookup_field on hyperlink serializers 2013-05-05 16:47:45 +01:00
Tom Christie
e4067bfb75 introduce lookup_field and add pendingdeprecationwarnings 2013-05-02 12:07:18 +01:00
Tom Christie
35f99cddc4 lookup_field on hyperlinked fields, and overriddable hyperlinked fields. Closes #688 2013-05-01 09:03:09 +01:00
Tom Christie
dc7b1d6430 2.2's PendingDeprecationWarnings now become DeprecationWarnings. 2.3's PendingDeprecationWarnings added. 2013-04-29 12:45:00 +01:00
Tom Christie
95abe6e844 Cleanup docstrings 2013-04-25 12:47:34 +01:00
Bouke Haarsma
126a0f739d Fixed #720 2013-03-10 21:02:34 +01:00
Craig de Stigter
84be169353 fix function names and dotted lookups for use in PrimaryKeyRelatedField.field_to_native (they work in RelatedField.field_to_native already) 2013-03-01 16:13:04 +13:00
Tom Christie
018298deb8 Relational fields use same field_to_native logic as regular fields.
Fixes #637. Closes #638.
2013-02-12 23:03:04 +00:00
Tom Christie
41ac1e8f32 Raise warnings if 'request' not in context for hyperlinked fields. 2013-02-12 13:54:50 +00:00
Marc Tamlyn
11610e7c3c Try the correct NoReverseMatch location. 2013-02-06 13:10:54 +00:00
Marc Tamlyn
bd7977eed7 Purge naked excepts.
Most of these had obvious exceptions which would be thrown. Some I'm not
sure about but they should at least catch only Exception so as not to
ignore SystemExit and other inappropriate Error classes.
2013-02-06 13:05:17 +00:00
Tom Christie
b052c92ac3 Cleanup imports
Mostly adding `from __future__ import unicode_literals` everywhere.
2013-02-04 20:55:35 +00:00
Tom Christie
b82227e517 remove broken import 2013-02-04 20:38:18 +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
e4ac566625 Add dprecation warnings 2013-01-30 20:33:50 +00:00
Tom Christie
e24d29ec05 Tweak empty list implementation 2013-01-30 14:21:18 +00:00
Tom Christie
be6df3ae3c Merge branch 'master' into many-fields
Conflicts:
	rest_framework/relations.py
2013-01-30 13:41:56 +00:00
Tom Christie
4601487248 Use many=True style for pk relations. 2013-01-30 12:41:18 +00:00
Fernando Rocha
fceacd830f Fix processing of ManyToManyField when it is empty
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
2013-01-29 18:46:05 -03:00
Tom Christie
4eb5861f36 Starting migration from ManyField to Field(many=True) 2013-01-18 23:36:35 +00:00
Tom Christie
211bb89eec Raise Validation Errors when relationships receive incorrect types. Fixes #590. 2013-01-18 21:29:21 +00:00
Tom Christie
eb3d4d0e93 Drop bits of relations_slug tests which don't mirror existing tests. 2013-01-16 14:32:51 +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
c1f194b0a5 Fix inconsistent view_name logic. Fixes #567. 2013-01-08 15:03:14 +00:00
Marc Tamlyn
5bded1ecf0 Use ResolveMatch.view_name so namespaces work. 2013-01-07 14:34:45 +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
eb14278a3b Add proper validation for updating relational fields with incorrect types. Fixes #446. 2013-01-04 13:50:40 +00:00
Tom Christie
6e9865cb71 Fix for #446. Note: Also needs applying to other relational types. 2013-01-03 23:17:31 +00:00
Tom Christie
bfea7f64ee Tweak behavior of hyperlinked fields that include an explicit format suffix. 2013-01-03 21:49:29 +00:00
Xavier Ordoquy
60250f22c8 Move the various compat things to the compat module. 2013-01-03 11:41:07 +01:00
Xavier Ordoquy
4b77b3c5ad Move the urlparse lib compatibility to the compat file. 2013-01-02 19:06:55 +01:00
Xavier Ordoquy
737349d238 Merge remote-tracking branch 'reference/py3k' into p3k 2013-01-02 16:09:21 +01:00
Tom Christie
8fad0a727a Relation fields move into relations.py 2012-12-31 08:53:40 +00:00