Ross McFarland
c36122a7ba
remove stray func from test
2013-10-21 14:26:21 -07:00
Ross McFarland
f0a129dcda
retract the default page stuff.
...
better way comming in a seperate pr
2013-10-21 14:23:06 -07:00
Tom Christie
216ac8a5c1
Use lookup_url_kwarg in presave if required
2013-10-21 17:19:28 +01:00
Tom Christie
76672787cd
Added . Closes #1188 .
2013-10-21 09:47:07 +01:00
Ross McFarland
63e6a3b492
paginator should validate page and provide default
...
- use the standard paginator.validate_number method rather
strict_postive_int.
- support optional paginator method, default_page_number, to get the default
page number rather than hard-coding it to 1
- this allows supporting non-integer based pagination which can be an
important performance tweak on extermely large datasets or high request
loads
- relatively thorough unit tests of the changes
2013-10-19 21:11:27 -07:00
dpetzel
17a00be830
This fix results in models.NullBooleanField rendering as a checkbox in the browsable API
2013-10-18 21:13:20 -04:00
dpetzel
735c75abb9
add test case around ensuring proper field inference for boolean model field types
2013-10-18 21:10:49 -04:00
Tom Christie
2394f05e5a
Merge pull request #1170 from craigds/write-into-foreignkey-with-source
...
fix writing into foreign key with non-null source
2013-10-17 07:59:29 -07:00
Tom Christie
6a40202a64
Merge pull request #1112 from tamakisquare/issue-1111
...
Test case and fix for issue 1111
2013-10-17 07:31:15 -07:00
Tom Christie
8c60471766
Merge pull request #1172 from brutasse/fix/return-object
...
Return object in save_object
2013-10-17 07:19:38 -07:00
Bruno Renié
cc3c16eaa0
Fix a docstring to reflect what the method does
2013-10-17 16:08:17 +02:00
badaud_t
b730aec0f4
Fix decimal support with YAMLRenderer
2013-10-17 01:08:24 +02:00
badaud_t
8a5fea06f0
Fix typo YAMLRendererTests
2013-10-17 01:07:50 +02:00
Omer Katz
d31fd33f4b
Allow to customize description so that markup can be accepted if needed.
2013-10-16 09:15:02 -04:00
Colin Huang
c6be12f02b
[Fix]: Error with partial=True and validate_<name>
...
The error occurs when serializer is set with partial=True and a
field-level validation is defined on a field, for which there's no
corresponding update value in .data
2013-10-15 17:05:10 -07:00
Craig de Stigter
86ea969e11
fix ticket link in test docstring
2013-10-11 15:50:07 +13:00
Craig de Stigter
7c3769f04b
fix writing into foreign key with non-null source
2013-10-11 15:31:55 +13:00
Tom Christie
f18158358d
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-10-10 17:34:15 +01:00
Tom Christie
c3e370b168
Merge branch 'html-form-rendering'
2013-10-10 17:33:39 +01:00
Tom Christie
9e29c63895
Ensure read-only fields don't break with current HTML renderer behavior
2013-10-10 17:33:22 +01:00
Carlton Gibson
0bbc775b95
Merge pull request #1071 from craigds/field-transform-methods
...
Feature: add transform_<fieldname> methods to serializers
2013-10-09 01:11:46 -07:00
Henry Clifford
3e94f4dc70
support args on get_object_or_404
2013-10-04 10:49:56 -04:00
Philip Douglas
a2ae469f6b
Merge remote-tracking branch 'upstream/master'
2013-10-03 11:12:55 +01:00
Craig de Stigter
dc650f77b5
add tests for transform_fieldname methods
2013-10-03 11:34:42 +13:00
Tom Christie
8d4ba478cc
Fix rendering of forms and add error rendering on HTML form
2013-10-02 16:13:34 +01:00
Tom Christie
a14f1e8864
Serializers can now be rendered directly to HTML
2013-10-02 13:45:35 +01:00
Tom Christie
1fd83adb9c
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-09-26 16:09:31 +01:00
Tom Christie
75d6446c87
Allow .template_name attribute specified on view. Closes #1000
2013-09-26 16:09:08 +01:00
Tom Christie
1bd8fe4152
Whitespace fix
2013-09-25 10:36:08 +01:00
Tom Christie
e441f85109
Drop 1.3 support
2013-09-25 10:30:04 +01:00
Tom Christie
21cd638659
Merge master
2013-09-25 09:44:26 +01:00
Markus Kaiserswerth
abbe9213f9
Address pending deprecation of Model._meta.module_name in Django 1.6
2013-09-23 17:48:25 +02:00
Carlton Gibson
b82c44af48
Correct typo in doc string.
2013-09-20 14:20:21 +02:00
Carlton Gibson
f07a4f4ca3
Clear cached serializer data on save()
+ test. Fixes #1116 .
2013-09-20 14:10:46 +02:00
Colin Huang
b74c5235c5
[Add]: CustomValidationTests.test_partial_update
...
This test is to make sure that validate_<attrname> is not called when
partial=True and <attrname> is not found in .data.
2013-09-15 22:22:52 -07:00
Tom Christie
36bd4f22a7
Merge pull request #1107 from dpretty/master
...
Let JSONEncoder handle Numpy data types.
2013-09-13 11:42:15 -07:00
Tai Lee
a9dbd46c94
Refs #1109 -- Update docs. Integrate changes from feedback.
2013-09-14 00:54:44 +10:00
Tai Lee
bb3261ca48
Fixed #1105 -- Add hook for custom context in BrowsableAPIRenderer
.
...
Replace hard coded response status check with `allow_form` context
variable, so that it can be overridden in a custom renderer class.
2013-09-13 23:11:44 +10:00
Rajiv Bose
0de1a1a0ad
Typo in strings referring to Python package, django-filter.
...
On skip of django_filters related unit-tests the reason given states the Python package 'django-filters' is not install.
However, the Python package required to run django_filters related tests is 'django-filter'.
2013-09-13 11:55:16 +01:00
Philip Douglas
e5da0ff5e5
Merge remote-tracking branch 'upstream/master'
2013-09-13 10:47:06 +01:00
Philip Douglas
272a6abf91
Try a more localised fix to the data=None problem
2013-09-13 10:46:24 +01:00
David Pretty
d489c5c881
Let JSONEncoder handle Numpy data types.
...
json.JSONEncoder cannot serialize Numpy data types. Numpy arrays
and array scalars have a tolist() method which casts the object to
a standard python data type.
2013-09-13 13:36:18 +10:00
Tom Christie
cd3040737e
Merge pull request #1097 from mociepka/add_default_order_by_in_filtering
...
Add order_by to the AutoFilterSet
2013-09-12 13:24:26 -07:00
Philip Douglas
6e4bdb5596
Add missing newline at the end of test file
2013-09-12 16:04:33 +01:00
Philip Douglas
59cce01b33
Fix error when serializer gets files but no data
2013-09-12 16:03:20 +01:00
Tom Christie
195790e60b
Version 2.3.8
2013-09-11 09:09:30 +01:00
Tom Christie
5970baa201
Tweaks and docs to object-level model permissions.
2013-09-10 21:00:13 +01:00
Tom Christie
75fb4b02b4
Merge branch 'master' of git://github.com/bwreilly/django-rest-framework into bwreilly-master
2013-09-10 20:21:15 +01:00
Michał Ociepka
222c1d1122
Add order_by to the AutoFilterSet
...
`AutoFilterSet` should contains `order_by` set to all by default.
2013-09-10 12:02:14 +02:00
bwreilly
23fc9dd53f
better doc for object permissions, drop redundant has_permission call
2013-09-09 09:32:29 -07:00
bwreilly
0183c69538
removed unnecessary guardian req and view.action parsing
2013-09-09 08:39:09 -07:00
bwreilly
9ff0f6d3bf
switch to a dedicated filter for read list object permissions
2013-09-07 23:48:03 -05:00
bwreilly
118645e480
first pass at object level permissions and tests
2013-09-07 23:18:52 -05:00
bwreilly
57d6b5fb7c
necessary test settings for guardian
2013-09-07 23:16:43 -05:00
Andy Freeland
b5523bcc7d
Support customizable view EXCEPTION_HANDLER
...
Add `api_settings.EXCEPTION_HANDLER` to support custom error responses.
Fixes #907 .
2013-09-06 12:47:33 -05:00
bwreilly
b07de86ad3
some properly failing tests, set up for standard permissions
2013-09-06 12:35:06 -05:00
bwreilly
4a9dcfa760
added guardian as optional requirement, stubbed out object-level permission class
2013-09-06 11:01:31 -05:00
Tom Christie
196a895fe4
Merge pull request #1076 from edmondwong/master
...
Allow OPTIONS to retrieve PUT field metadata on empty objects
2013-09-05 12:24:17 -07:00
Edmond Wong
6e7e4fc01c
Added test for OPTIONS before object creation from a PUT
2013-09-03 12:30:18 -07:00
Yuri Prezument
745ebeca77
Handle case where obj=None in PKRelatedField.field_to_native()
...
Fixes #1072
2013-08-31 17:20:49 +03:00
Yuri Prezument
a15cda4be4
Regression test for #1072
2013-08-31 17:10:15 +03:00
Edmond Wong
3063a50fc2
Allow OPTIONS to retrieve PUT field metadata on empty objects
...
This allows OPTIONS to return the PUT endpoint's object serializer metadata when the object hasn't been created yet.
2013-08-30 18:03:44 -07:00
Tom Christie
9a5b2eefa9
Merge master
2013-08-30 09:28:33 +01:00
Tom Christie
f3ab0b2b1d
Browsable API tab preferences should be site-wide
2013-08-30 09:20:12 +01:00
Tom Christie
cba972911a
Fix failing empty serializer test
2013-08-30 09:12:39 +01:00
Tom Christie
3fba60e99c
Drop broken placeholder serializations.
2013-08-30 09:02:54 +01:00
Tom Christie
2247fd68e9
Fix multipart error when used via content-type overloading
2013-08-29 21:24:29 +01:00
Tom Christie
19f9adacb2
Merge branch 'master' into display-raw-data
2013-08-29 20:52:46 +01:00
Tom Christie
02b6836ee8
Fix breadcrumb view names
2013-08-29 20:51:51 +01:00
Tom Christie
e4d2f54529
Fix indenting on raw data forms
2013-08-29 20:39:05 +01:00
Tom Christie
44f8d1bef2
Fix tab preferences on PUT forms
2013-08-29 20:38:55 +01:00
Tom Christie
1fa2d823cc
Preserve tab preference in cookies.
2013-08-29 20:35:59 +01:00
Tom Christie
c7f3b8bebe
Include serialized content in raw data form.
2013-08-29 17:23:26 +01:00
Mathieu Pillard
11071499a7
Make ChoiceField.from_native() follow IntegerField behaviour on empty values
2013-08-29 18:10:47 +02:00
Tom Christie
37e2720a40
Add override_method
context manager and cleanup.
2013-08-29 12:55:56 +01:00
Craig de Stigter
94cd136943
add transform_<fieldname> methods to serializers, which basically do the opposite of validate_<fieldname> on a per-field basis.
2013-08-29 17:35:15 +12:00
Tom Christie
18007d6846
Simplifying raw data renderering support
2013-08-28 21:52:56 +01:00
Tom Christie
2d5e14a8d3
Throttles now use HTTP_X_FORWARDED_FOR, falling back to REMOTE_ADDR to identify anonymous requests
2013-08-28 15:32:41 +01:00
Tom Christie
97b52156cc
Added .cache
attribute on throttles.
...
Closes #1066 . More localised than a new settings key, and more
flexible in that different throttles can use different behavior.
Thanks to @chicheng for the report! :)
2013-08-28 13:34:14 +01:00
Tom Christie
4c53fb883f
Tweak MAX_PAGINATE_BY behavior in edge case.
...
Always respect `paginate_by` settings if client does not specify page
size. (Even if the developer has misconfigured, so that `paginate_by >
max`.)
2013-08-28 12:52:38 +01:00
Tom Christie
e1b54f2a2a
Merge branch 'max_paginate_by' of git://github.com/alexander-akhmetov/django-rest-framework into alexander-akhmetov-max_paginate_by
2013-08-27 20:58:30 +01:00
Alexander Akhmetov
7fb3f078f0
fix for python3
2013-08-27 17:42:10 +04:00
Tom Christie
b54cbd292c
Use view.settings for API settings, to make testing easier.
2013-08-27 12:36:06 +01:00
Tom Christie
b430503fa6
Move exception handler out of main view
2013-08-27 12:32:33 +01:00
Tom Christie
dce47a11d3
Move settings into more sensible ordering
2013-08-27 12:32:13 +01:00
Tom Christie
8d590ebfde
First hacky pass at displaying raw data
2013-08-27 11:22:19 +01:00
Alexander Akhmetov
316de3a8a3
Added max_paginate_by parameter
2013-08-26 20:14:17 +04:00
Tom Christie
ab68d355f5
Merge pull request #1058 from ericbuehl/master
...
parameterize identity field serializer class to allow for easier subclassing
2013-08-25 12:46:11 -07:00
Eric Buehl
9d3fae27fd
parameterize identity field class to allow for easier subclassing
2013-08-23 16:48:32 +00:00
Tom Christie
be0f5850c3
Extra docs
2013-08-23 16:51:34 +01:00
Tom Christie
c77e4a2c59
Merge branch 'master' into html-form-renderer
2013-08-23 16:46:14 +01:00
Tom Christie
436e66a42d
JSON responses should not include a charset
2013-08-23 16:45:55 +01:00
Tom Christie
e23d588852
Adding standard renderer attributes and documenting
2013-08-23 16:16:41 +01:00
Tom Christie
10d386ec6a
Cleanup and dealing with empty form data.
2013-08-23 16:10:20 +01:00
Tom Christie
1c935cd3d2
Fix failing test for router with no trailing slash
2013-08-23 15:18:47 +01:00
Tom Christie
005f475c6a
Don't consume .json style suffixes with routers.
...
When trailing slash is false, the lookup regex should not consume '.'
characters. Fixes #1057 .
2013-08-23 14:58:06 +01:00
Tom Christie
b72a99fef2
Merge branch 'display-nested-data' into html-form-renderer
2013-08-23 14:39:52 +01:00
Tom Christie
0966a2680b
First pass at HTMLFormRenderer
2013-08-23 14:38:31 +01:00
Tom Christie
e03854ba6a
Tweaks to display nested data in empty serializers
2013-08-23 14:06:14 +01:00
Tom Christie
e7927e9bca
Extra docs on PATCH with no object.
2013-08-23 13:35:50 +01:00
Tom Christie
110d549404
Merge pull request #1034 from KrzysiekJ/patch-create-fallback-removal
...
PATCH requests should not be able to create objects.
2013-08-23 05:34:00 -07:00
Tom Christie
95b2bf50fb
Add validation error test when passing non-file to FileField
2013-08-23 12:03:54 +01:00
Tom Christie
47d17b088a
Merge branch 'fix_937' of git://github.com/aburgel/django-rest-framework into aburgel-fix_937
2013-08-23 11:56:22 +01:00
Tom Christie
19a774f972
force_authenticate(None) also clears session info.
...
Closes #1055 .
2013-08-23 11:21:52 +01:00
Tom Christie
f631f55f8e
Tweak comment
2013-08-21 21:35:17 +01:00
Tom Christie
16ffdedd14
Merge master
2013-08-21 21:31:59 +01:00
Tom Christie
44ceef8415
Updating 2.4.0 release notes
2013-08-21 21:30:25 +01:00
Tom Christie
2bcad32dcb
If page size query param <= 0, just use default page size.
...
Closes #1028 .
2013-08-21 21:22:12 +01:00
Tom Christie
815ef50735
If page size query param <= 0, just use default page size.
...
Closes #1028
2013-08-21 21:18:46 +01:00
Tom Christie
db25aaff3a
Merge branch 'static-routes' into 0.4.0
2013-08-21 20:36:07 +01:00
Tom Christie
7cc1d38d22
Merge branch 'boolean-field-required-1004' of git://github.com/willkg/django-rest-framework
2013-08-19 21:44:52 +01:00
Tom Christie
28ff6fb1ec
Only HTML forms should have implicit default False for boolean fields
2013-08-19 21:44:47 +01:00
Tom Christie
8acee2e626
Commenting link/action decorators as pending deprecation
2013-08-19 21:02:22 +01:00
Tom Christie
28e44efe25
Merge branch 'master' into 2.4.0
2013-08-19 20:58:28 +01:00
Tom Christie
c607414f16
Merge
2013-08-19 20:36:18 +01:00
Tom Christie
5120670624
Document customizable view names/descriptions
2013-08-19 08:45:53 +01:00
Tom Christie
89b0a539c3
Move view name/description functions into public space
2013-08-19 08:24:27 +01:00
Tom Christie
a8aabe23c9
Merge branch 'master' of git://github.com/chrispaolini/django-rest-framework into chrispaolini-master
2013-08-19 07:40:30 +01:00
Christopher Paolini
5a374955b1
Updated tests for view name and description
...
Updated the tests to use the default view_name and view_description
functions in the formatter through the default in settings.
2013-08-18 00:29:05 -04:00
Christopher Paolini
11d7c1838a
Updated default view name/description functions
...
Forgot to update the default view name/description functions to the new
setup.
2013-08-17 17:52:08 -04:00
Christopher Paolini
e6662d434f
Improved view/description function setting
...
Now supports each View having its own name and description function and
overriding the global default.
2013-08-17 17:44:51 -04:00
Christopher Paolini
a95984e4d4
Settings now have default functions
...
Updated the setting to have a default function.
2013-08-16 13:23:04 -04:00
Will Kahn-Greene
430f00847a
Add test for BooleanField and required
...
This tests setting required=True on a BooleanField.
Test for issue #1004 .
2013-08-16 09:20:49 -04:00
Tom Christie
f6f69dc71d
Version 2.3.7
2013-08-16 14:03:20 +01:00
Tom Christie
7b27997a01
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-08-15 21:36:54 +01:00
Tom Christie
f34b9ff049
AnonRateThrottle should always allow authenticated users. Closes #994
2013-08-15 21:36:45 +01:00
Christopher Paolini
d07dae6e79
Ability to override name/description of view
...
Added settings and additions to formatting.py
2013-08-15 12:41:52 -04:00
Chad Barrington
99083baf25
Update filters.py
...
Fixed cut n pasted get_ordering docstring for ya bro.
2013-08-14 16:01:25 -05:00
Chad Barrington
486f4c8047
Update filters.py
...
Here's a little cleanup for ya, brah!
2013-08-14 15:18:44 -05:00
Tom Christie
44401273f7
Merge pull request #1038 from jsatt/nontime_throttling
...
don't set X-Throttle-Wait-Second header if throttle wait is None
2013-08-14 05:15:57 -07:00
JT
2f03870ae1
Fix for "No module named compat"
2013-08-13 18:48:49 -05:00
Jeremy Satterfield
1d8a80f5cc
don't set X-Throttle-Wait-Second header if throttle wait is None
2013-08-13 15:31:58 -05:00
Krzysztof Jurewicz
e677f3ee5c
PATCH requests should not be able to create objects.
2013-08-13 13:26:30 +02:00
Yuri Prezument
ff1efcf60f
If null or blank - don't save the nested object
2013-08-12 21:06:37 +03:00
Yuri Prezument
901d2b0eb8
Failing test case for nullifying nested object
2013-08-12 21:06:37 +03:00
Yuri Prezument
abe655e061
Make OneToOneSource.target nullable
2013-08-12 21:06:37 +03:00
Yuri Prezument
cd5f1bb229
Fix PATCH button title in template
2013-08-12 15:44:00 +03:00
Tom Christie
fbd4c4ee8f
Merge pull request #1030 from etos/patch-2
...
Spelling correction on read_only_fields err msg
2013-08-12 01:25:36 -07:00
Dan Stephenson
bbdcbe9452
Spelling correction on read_only_fields err msg
...
just spotted extras
2013-08-10 01:22:47 +01:00
Dan Stephenson
edd696292c
Spelling correction on read_only_fields err msg
2013-08-10 01:12:36 +01:00
Kevin Brown
103fed9667
Fixed reversed arguments in assertion
2013-07-26 10:59:51 -04:00
Alex Burgel
db9672d304
Add support for removing field files by sending an empty string
2013-07-24 17:24:29 -04:00
Pavel Zinovkin
b6d6feaa02
Fixed test
2013-07-21 22:43:19 +04:00
Pavel Zinovkin
2e18fbe373
Updated EmailField error message. This one already available in django translations.
...
https://github.com/django/django/blob/master/django/conf/locale/ru/LC_MESSAGES/django.po#L343
2013-07-21 17:03:58 +04:00
Alex Burgel
eaae8fb2d9
Combined link_* and action_* decorators into detail_route and list_route, marked the originals as deprecated.
2013-07-15 18:35:13 -04:00
Alex Burgel
ca7ba07b4e
Introduce DynamicDetailRoute and DynamicListRoute to distinguish between different route types
2013-07-15 17:59:37 -04:00
Alex Burgel
e14cbaf696
Changed collection_* decorators to list_*
2013-07-15 17:59:36 -04:00
Alex Burgel
f022743078
Rename router collection test case
2013-07-15 17:59:36 -04:00
Alex Burgel
8d521c068a
Revert route name change and add key to Route object to identify different route types
2013-07-15 17:59:36 -04:00
Alex Burgel
d72603bc6a
Add support for collection routes to SimpleRouter
2013-07-15 17:59:03 -04:00
Tom Christie
82145e2b06
Only include APISimpleTestCase and APILiveServerTestCase from django 1.4 onwards
2013-07-15 21:54:13 +01:00
Tom Christie
ae63c49777
Added test case classes
2013-07-15 11:38:38 +01:00
Tom Christie
3032a06c9b
Use absolute import style
2013-07-09 13:12:28 +01:00
Gertjan Oude Lohuis
db863be10c
Add an ModelAdmin for easy management of Tokens
2013-07-09 12:19:13 +02:00
Tom Christie
8f79caf9d1
Use 'force_text', not 'unicode', for compat across python version
2013-07-05 09:07:18 +01:00
Tom Christie
676ab4971c
Merge branch 'remove-hold-down-control-messages' of git://github.com/rouge8/django-rest-framework into rouge8-remove-hold-down-control-messages
2013-07-05 08:55:24 +01:00
Tom Christie
9e4e2c60f7
Merge branch 'master' into 2.4.0
2013-07-04 20:31:26 +01:00
Tom Christie
99794773cf
Merge pull request #962 from tomchristie/test-client
...
APIClient and APIRequestFactory
2013-07-04 05:50:04 -07:00
Tom Christie
5fa100245c
Update parser docstrings. Closes #968 .
2013-07-04 12:47:35 +01:00
Andy Freeland
7d43f41e4a
Remove 'Hold down "Control" ...' message from help_text
...
When getting the help_text from a field where `many=True`, Django
appends 'Hold down "Control", or "Command" on a Mac, to select more than
one.' to the help_text. This makes some sense in Django's ModelForms,
but no sense in the API.
2013-07-04 01:51:24 -04:00
Tom Christie
0a722de171
Complete testing docs
2013-07-01 13:59:05 +01:00
Tom Christie
c9485c783a
Rename to force_authenticate
2013-06-29 22:53:15 +01:00
Tom Christie
ab799ccc3e
Simplify APIClient implementation
2013-06-29 21:34:47 +01:00
Tom Christie
664f8c6365
Added APIClient.authenticate()
2013-06-29 21:02:58 +01:00
Tom Christie
35022ca921
Refactor SessionAuthentication slightly
2013-06-29 08:14:05 +01:00
Tom Christie
f7db06953b
Remove unneeded tests.utils, superseeded by APIRequestFactory, APIClient
2013-06-29 08:06:11 +01:00
Tom Christie
90bc07f3f1
Addeded 'APITestClient.credentials()'
2013-06-29 08:05:08 +01:00
Tom Christie
f585480ee1
Added APIClient
2013-06-28 17:50:30 +01:00
Tom Christie
7224b20d58
Added APIRequestFactory
2013-06-28 17:17:39 +01:00
Tom Christie
05d8a90e94
Merge branch 'master' into writable-nested-modelserializer
2013-06-28 09:36:17 +01:00
Tom Christie
4ee9cdc7af
Fix compat datetime import when oauth2 provide does not support timezone aware datetimes
2013-06-28 09:35:52 +01:00
Tom Christie
58d38d694e
Merge branch 'master' into writable-nested-modelserializer
2013-06-28 09:07:09 +01:00
Tom Christie
379ad8a824
pending deprecations -> deprecated
2013-06-27 20:36:14 +01:00
Tom Christie
3fcc01273c
Remove deprecated code
2013-06-27 20:29:52 +01:00
Tom Christie
7ba2f44a0f
Version 2.3.6
2013-06-27 13:00:05 +01:00
Tom Christie
e0dddbc5de
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-06-27 12:32:46 +01:00
Tom Christie
96f41fd12d
Use imported views to expose python 2.6 bug. Refs #943
2013-06-27 11:58:34 +01:00
Tom Christie
7e67ad666b
Merge pull request #953 from j4mie/prevent-duplicate-routing
...
Prevent dynamically routing to a method that is already routed to.
2013-06-26 15:37:42 -07:00
Jamie Matthews
c127e63c32
Raise exception when attempting to dynamically route to a method that is already routed to. Fixes #940
2013-06-26 23:00:42 +01:00
Tom Christie
91b9fcb0ba
Minor test cleanup
2013-06-26 22:43:17 +01:00
Tom Christie
35e4d1cf9c
Merge pull request #943 from trwired/utf8safedocs
...
Make browsable API views play nice with utf-8
2013-06-26 14:41:07 -07:00
Tom Christie
69e5e3cc0d
Use timezone aware datetimes with oauth2 provider, when supported. Closes #947 .
2013-06-26 21:18:13 +01:00
Igor Kalat
c8b0e6c40f
Refactored get_view_description, moved appropriate tests to test_description.py
2013-06-26 22:12:02 +02:00
Tom Christie
715bd47dfa
Use AUTH_USER_MODEL consistently between various Django versions. Closes #946
2013-06-26 17:56:42 +01:00
Igor Kalat
2bf5f63050
Make browsable API views play nice with utf-8
2013-06-22 19:21:28 +02:00
Tom Christie
8cc63b09f6
Add support for StreamingHttpResponse. Closes #939
2013-06-21 22:42:04 +01:00
Tom Christie
8b0d4115c6
Merge pull request #941 from FreakyDug/master
...
Fixed a couple of small problems I found when using the action decorator.
2013-06-21 14:23:40 -07:00
Tom Christie
209b65f426
Update assertion error to reference 'base_name' argument, not incorrect 'name' argument. Closes #933
2013-06-21 22:13:25 +01:00
Tom Christie
3d4bb4b553
Ensure action kwargs properly handdled. Refs #940 .
2013-06-21 22:03:07 +01:00
Philip Douglas
fa9f5fb8dc
Allow uppercase methods in action decorator.
...
Previously, using uppercase for the method argument would silently fail
to route those methods.
2013-06-21 16:28:17 +01:00
Tom Christie
6d2ca75d8e
Don't raise AttributeError on views with no model or queryset, when using DjangoModelPermissions
2013-06-18 11:10:56 +01:00
Tom Christie
4ad1094968
HyperlinkedModelSerializer supports overriding of 'url' field. Closes #936
2013-06-17 15:09:36 +01:00
Tom Christie
52298480c2
Clean up
2013-06-14 15:39:56 +01:00
Tom Christie
df957c8625
Fix and tests for ScopedRateThrottle. Closes #935
2013-06-14 14:18:40 +01:00
Tom Christie
614d8fec3c
Merge pull request #929 from mhsparks/positive-integer-field
...
Added test for custom fields with min_value and max_value validators
2013-06-12 12:39:57 -07:00
Tom Christie
c4ab77b9e9
Merge pull request #926 from davesque/master
...
I was having problems with a custom field that used a min_value validator...
2013-06-12 12:38:35 -07:00
inglesp
b1847412b5
Typo
2013-06-12 20:00:33 +02:00
Mark Hughes
82c515c19c
Added test for custom fields with min_value and max_value validators
2013-06-12 17:36:16 +01:00
David Sanders
fcaca73709
Pep8 lint
2013-06-11 16:10:25 -06:00
David Sanders
656897c2da
Update ModelField to work with a broader range of fields
...
Add support for fields that use min and max value validators.
2013-06-11 16:09:32 -06:00
Ethan Fremen
d89aade343
Allow the default router to have a custom name.
...
Signed-off-by: Ethan Fremen <ethan@matterport.com>
2013-06-07 19:49:18 -07:00
Ethan Fremen
ae2887ffc4
Set the args and kwargs before initializing the request.
...
Allows get_parser_context to function correctly.
Signed-off-by: Ethan Fremen <ethan@matterport.com>
2013-06-07 19:25:39 -07:00
Tom Christie
db8d61196a
Merge pull request #915 from aburgel/fix-oauth-bad-consumer-key
...
Fix serialization exception caused by non-existent consumer
2013-06-06 00:58:54 -07:00
Tom Christie
40e09472d8
Never deepcopy validators. Closes #913
2013-06-06 08:56:39 +01:00
Alex Burgel
ecb8a460c9
Fix serialization exception when using non-existent consumer
2013-06-05 17:02:44 -04:00
Tom Christie
f8a0d31d71
Remove ConfigurationError in favor of Django's ImproperlyConfigured
2013-06-05 13:45:28 +01:00
Tom Christie
de00ec95c3
Merge master
2013-06-05 13:33:19 +01:00
Tom Christie
2ca243a114
Fix up tests and tox
2013-06-05 13:20:06 +01:00
Tom Christie
f1251e8c58
Added trailing_slash argument to routers. Closes #905
2013-06-04 20:59:12 +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
478f6ff94a
Regression test for #840 . Closes #840 .
2013-06-03 21:21:47 +01:00
Tom Christie
87b8cb8524
Merge pull request #904 from menghan/fix-doc-typo
...
fix doc typo
2013-06-03 08:04:32 -07:00
Tom Christie
28c2c46a03
Version 2.3.5
2013-06-03 12:34:18 +01:00
Tom Christie
6e0567c271
request.user should be still be accessible in renderer context if authentication fails
2013-06-03 12:32:57 +01:00
Tom Christie
62e59f8277
Merge pull request #900 from copitux/fix-validation-layer
...
Bugfix: Fix run validation layer with invalid data
2013-06-03 00:49:02 -07:00
Tom Christie
1bb5fb8e4a
Merge pull request #895 from linovia/django1.6a1
...
Added Django 1.6a1 to the test matrix.
2013-06-02 13:11:49 -07:00
Tom Christie
a3796f430b
Only use test import munging prior to Django 1.6's new test runner
2013-06-02 21:04:47 +01:00
Tom Christie
27d8b848bc
Add notes on 'method' argument to '@action' decorator
2013-06-02 20:40:56 +01:00
Tom Christie
b15a6ccef2
Serializer field 'default' argument may be a callable
2013-06-02 20:12:49 +01:00
Tom Christie
01e80ff9f7
Merge branch 'master' of https://github.com/woakas/django-rest-framework
2013-06-02 20:05:37 +01:00
Tom Christie
372ad01b74
Test cleanup
2013-06-02 19:56:15 +01:00
Tom Christie
8b73dce51d
view_name argument to HyperlinkedModelSerializer is now properly enforced. Closes #471
2013-06-02 19:50:24 +01:00
Menghan
b8aec1277c
fix doc typo
2013-06-02 12:12:14 +08:00
Tom Christie
d7753123f6
HyperlinkedModelSerializer lookup_field option should apply to HyperlinkedIdentityField
2013-05-31 11:50:37 +01:00
Tom Christie
c36ff4e052
Cleaning up imports and whitespace
2013-05-31 11:17:33 +01:00
Tom Christie
fdf9a26740
Remove unused test helper module
2013-05-31 11:14:37 +01:00
David Medina
c176af35e5
Improve avoid validation test: #900
2013-05-30 09:07:30 +02:00
Gustavo Andrés Angulo
de1cc5f8c1
Fix default field when is a simple callable function.
2013-05-29 11:45:54 -05:00
Tom Christie
c98ac3e83e
Added get_url hook to HyperlinkedIdentityField in line with HyperlinedRelatedField. Closes #883
2013-05-29 14:09:31 +01:00
David Medina
d11b55648c
Bugfix: Fix run validation layer with invalid data
2013-05-29 12:55:42 +02:00
Xavier Ordoquy
732269160f
Use absolute name imports for tests if django version is 1.6+.
2013-05-29 10:18:38 +02:00
Tom Christie
85fe7197bf
Change test urls to match 1.6 test module name style
2013-05-29 09:00:30 +01:00
Tom Christie
cb49c5d3c0
Rename test modules to 1.6 style
2013-05-29 08:57:11 +01:00
Stephan Groß
f6d7f54fc1
Merge pull request #897 from pborreli/typos
...
Fixed typos
2013-05-28 07:39:56 -07:00
Pascal Borreli
8f35ac4f93
Fixed typos
2013-05-28 15:09:23 +01:00
Tom Christie
22e1950e1c
Backwards compatible approach to HyperlinkedIdentityField URLs. Closes #892
2013-05-28 12:08:36 +01:00
Tom Christie
138f0cacdb
Raise 404 on incorrect lookup type in URL, not 500. Closes #890 .
2013-05-28 11:57:11 +01:00
Tom Christie
2a38aa7291
Version 2.3.4
2013-05-24 23:55:59 +01:00
Tom Christie
fcaee6e580
Clean up OPTIONS implementation
2013-05-24 23:44:23 +01:00
Alex Burgel
112b52f57e
Allow action decorator to handle multiple http methods
2013-05-24 18:28:47 -04:00
Tom Christie
760e8642bd
Merge branch 'issue-192-expose-fields-for-options' of https://github.com/grimborg/django-rest-framework into improved-options-support
2013-05-24 21:21:56 +01:00
Oscar Vilaplana
a1deb5eac7
simplified, moved field humanizing to Field. broken tests
2013-05-23 08:26:55 +02:00
Tom Christie
7a93fdbe0a
Last bits of charset sorting-out-ness
2013-05-22 16:46:15 +01:00
Tom Christie
17699056af
Use assertEqual, not assertEquals
2013-05-22 16:45:56 +01:00
Tom Christie
0c2b534d95
Minor cleanup
2013-05-22 09:29:43 +01:00
Tom Christie
06b28f66ed
Tweak method ordering for better consistency
2013-05-22 09:07:12 +01:00
Tom Christie
cdc3c37465
Merge and styling fixes
2013-05-21 12:01:56 +01:00
Tom Christie
aef7ac72cc
content type may be set explicitly on the response
2013-05-20 21:18:17 +01:00
Tom Christie
f19e0d544f
Fix charset issues
2013-05-20 21:00:56 +01:00
David Jones
c3fd7c6685
Updated SlugField to raise validation errors for invalid slugs
2013-05-20 13:04:38 +01:00
Oscar Vilaplana
dea0b6ab7f
removed TODO
2013-05-19 15:48:16 +02:00
Oscar Vilaplana
259153b3f9
removed TODO
2013-05-19 15:47:50 +02:00
Oscar Vilaplana
9133ef77ab
removed TODO
2013-05-19 15:47:23 +02:00
Oscar Vilaplana
7a5cd090aa
fixed tests, added docs, renamed helper method
2013-05-19 15:45:33 +02:00
Oscar Vilaplana
6bbedfd7ae
fixed merge conflict
2013-05-19 15:18:40 +02:00
Nikolaus Schlemm
31893cff74
* make test assertion more explicit
...
* cleanup
2013-05-19 15:12:01 +02:00
Oscar Vilaplana
e80488b619
Added min_length and max_length
2013-05-19 15:08:41 +02:00
Oscar Vilaplana
edbf65c06e
Removed unused imports
2013-05-19 15:06:24 +02:00
Oscar Vilaplana
696c053f4f
s/Single Character/String/
2013-05-19 15:04:43 +02:00
Nikolaus Schlemm
88c94f3720
Merge remote-tracking branch 'grimborg/issue-192-expose-fields-for-options' into issue-192-expose-fields-for-options
2013-05-19 14:58:11 +02:00
Oscar Vilaplana
f1f5f92d89
Added tests, cleaned up imports
2013-05-19 14:55:46 +02:00
Nikolaus Schlemm
efca5f6fec
use double quotes for docstring instead of single quotes
2013-05-19 14:54:16 +02:00
Nikolaus Schlemm
b07cfdcf54
FIXED TEST FOR: don't expose fields for GET and DELETE - leaving room for parameters like e.g. filter or paginate
2013-05-19 13:54:13 +02:00
Nikolaus Schlemm
5473f60192
Merge remote-tracking branch 'grimborg/issue-192-expose-fields-for-options' into issue-192-expose-fields-for-options
2013-05-19 13:46:17 +02:00
Nikolaus Schlemm
1154c12b33
don't expose fields for GET and DELETE - leaving room for parameters like e.g. filter or paginate
2013-05-19 11:37:12 +02:00
Nikolaus Schlemm
a91841f7fe
WORKAROUND: avoid errors like "AttributeError: 'APIRoot' object has no attribute 'get_serializer'"
2013-05-19 11:29:41 +02:00
Oscar Vilaplana
08e9e2042c
Disabled label and help_text in unit test. We should change the test so
...
that it sets them up.
2013-05-19 11:26:56 +02:00
Oscar Vilaplana
b915c1d4d8
Made field label optional in OPTIONS
2013-05-19 11:15:38 +02:00
Nikolaus Schlemm
c0f3a1c397
Integrated status quo of grimborg's awesome humanize_field() for exposing field metadata via OPTIONS :)
2013-05-19 09:25:02 +02:00
Nikolaus Schlemm
9454e23aa9
Merge branch 'master' of git://github.com/tomchristie/django-rest-framework into issue-192-expose-fields-for-options
2013-05-19 09:02:07 +02:00
Tom Christie
7c945b43f0
Only use object permissions in browsable api form generation if an object exists
2013-05-18 23:52:02 +01:00
Tom Christie
4802177766
Enforce object permissions check when rendering forms in browseable API
2013-05-18 21:19:53 +01:00
Tom Christie
4631b91e14
Fix broken 'binary content' in browseable API
2013-05-18 21:12:44 +01:00
Nikolaus Schlemm
843ae60237
Merge branch 'issue-192-expose-fields-for-options' of git://github.com/grimborg/django-rest-framework into issue-192-expose-fields-for-options
...
Conflicts:
rest_framework/tests/fields.py
2013-05-18 18:34:21 +02:00
Nikolaus Schlemm
7f1cc82f96
added unittests for permission check of exposing actions via OPTIONS
2013-05-18 18:29:51 +02:00
Oscar Vilaplana
fecadacab1
added tests for form
2013-05-18 18:27:53 +02:00
Tom Christie
d4721fc1f7
Correct charset on UnicodeJSONRenderer
2013-05-18 17:25:38 +01:00
Tom Christie
bac4bf6e95
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-05-18 17:22:27 +01:00
Tom Christie
0d3d66cb02
Added proper charset support
2013-05-18 17:21:43 +01:00
Oscar Vilaplana
4dffcb5d77
Added humanized field names and types
2013-05-18 18:10:17 +02:00
Tom Christie
1888f4a1f0
Merge pull request #865 from ryankask/issue-747-lazy-strings-serialized
...
Issue 747 lazy strings serialized
2013-05-18 09:05:42 -07:00
Ryan Kaskel
579f77ceaa
Move function to compat.
2013-05-18 17:04:17 +01:00
Tom Christie
6d5cf527c3
Merge pull request #864 from minddust/fix_missing_min_values
...
Fix missing min values
2013-05-18 08:56:24 -07:00
Nikolaus Schlemm
5ab7cc6e6b
HEAD and OPTIONS should not be exposed as actions as discussed in a42afa04c3 (commitcomment-3241476)
2013-05-18 17:38:47 +02:00
Markus Törnqvist
99848b0321
Drop another case of u'', this time from #530 code
2013-05-18 18:38:37 +03:00
Markus Törnqvist
1fd66fe8c6
Drop u'', it was used inconsistently and breaks for nothing with Python 3.2
2013-05-18 18:27:36 +03:00
Ryan Kaskel
33f702d306
Merge latest changes from master.
2013-05-18 16:26:17 +01:00
Ryan Kaskel
10e451a85a
Handle Python 3 strings and lazy strings.
2013-05-18 16:21:18 +01:00
Stephan Groß
025c40e7d5
Fix order for applying min_value to fields
2013-05-18 17:16:29 +02:00
Nikolaus Schlemm
b225b1d5c9
Merge branch 'master' of git://github.com/tomchristie/django-rest-framework into issue-192-expose-fields-for-options
2013-05-18 17:13:59 +02:00
Markus Törnqvist
48c1b2233b
Merge branch 'master' into mjtorn-master
...
Conflicts:
rest_framework/serializers.py
rest_framework/tests/serializer.py
Fixed conflicts
2013-05-18 18:13:31 +03:00
Nikolaus Schlemm
a42afa04c3
draft for fields' metadata via OPTIONS - needs review and decision
2013-05-18 17:13:23 +02:00
Nikolaus Schlemm
b4dbfa9832
only catch relevant exceptions ;)
2013-05-18 17:10:13 +02:00
Pablo Recio
b9b2297612
Tests proper encoding in JSONRenderer and UnicodeJSONRenderer
2013-05-18 17:06:54 +02:00
Pablo Recio
6dbbbc16da
Better checking if the content can be printable in the BrowsableAPI
2013-05-18 17:06:54 +02:00
Pablo Recio
97f034e3d6
Adds UnicodeJSONRenderer which doesn't ensure ascii
2013-05-18 17:06:54 +02:00
Pablo Recio
c69f960066
Adding a class attribute into JSONRenderer for ensuring ascii, and using it consistently
2013-05-18 17:06:54 +02:00
Stephan Groß
0c81d04170
Add min_value=0 to autogenerated Pos..IntFields
2013-05-18 17:04:20 +02:00
Karol Majta
5bebd29f11
Merge branch 'master' of git://github.com/tomchristie/django-rest-framework
2013-05-18 16:56:38 +02:00
Karol Majta
ebe959b52a
charset param gets now appended to response's Content-Type. Closes #807
2013-05-18 16:45:05 +02:00
Markus Törnqvist
2795e842d6
Two test cases for html rendering of API with labelized model
2013-05-18 17:44:40 +03:00
Markus Törnqvist
e68ea16d7a
Update FieldLabelTest to use new BasicModel.verbose_name
2013-05-18 17:43:47 +03:00
Markus Törnqvist
e2a5ec0350
Change BasicModel.verbose_name
...
Isn't it nicer to test for a text which is different from
what the previous broken behavior was? Now we can really
tell it works!
2013-05-18 17:42:56 +03:00
Tom Christie
3f47eb7a77
Merge pull request #861 from minddust/fix_missing_field_values
...
Remove default values - django sets them for us - cause of #710
2013-05-18 07:32:50 -07:00
Stephan Groß
6714b755f4
Fix missing para..
2013-05-18 16:32:31 +02:00
Stephan Groß
aeea32030b
Add newline
2013-05-18 16:27:11 +02:00
Tom Christie
5f8d353f0b
Rename has_user_through_model -> has_through_model
2013-05-18 15:25:49 +01:00
Stephan Groß
9f9cb97d65
Add TestCases for default field values
2013-05-18 16:24:54 +02:00
Tom Christie
e1a3cab400
Merge pull request #854 from ryankask/issue-775
...
All relations pointing to ManyToManyFields should default to read-only
2013-05-18 07:22:22 -07:00
Nikolaus Schlemm
f8c1481d4b
expose the fields metadata via OPTIONS as described in https://github.com/tomchristie/django-rest-framework/issues/192
...
missing:
- get fields for method (currently all the same)
- tests
- right placement of code
2013-05-18 16:21:25 +02:00
Tom Christie
cc39b9c925
Merge pull request #858 from minddust/fix_710
...
Fix for #710
2013-05-18 07:19:52 -07:00
Tom Christie
e32a6e4211
Merge pull request #860 from andymckay/master
...
startswith can take a tuple
2013-05-18 07:17:13 -07:00
Pablo Recio
7dca0e6859
Removed unicode literals
2013-05-18 16:12:48 +02:00
Pablo Recio
50ba26822d
Merge branch 'master' into 675-empty-label-related-field
2013-05-18 16:11:06 +02:00
Andy McKay
aeba5bed05
startswith can take a tuple
2013-05-18 07:09:24 -07:00
Stephan Groß
b7176065a9
Update getattr
2013-05-18 16:06:30 +02:00
Tom Christie
ea9a3d88bc
Merge pull request #859 from craigds/master
...
fix for #765
2013-05-18 07:06:21 -07:00
Markus Törnqvist
e2d3aa65d7
Move and rename LabelModelSerializer for further reuse
2013-05-18 16:56:26 +03:00
Tom Christie
80a2600891
Styling tweaks
2013-05-18 14:55:48 +01:00
Markus Törnqvist
e7ddaf5472
Turns out label and help_text are not always there
2013-05-18 16:50:59 +03:00
Stephan Groß
eb9fdd04fc
Remove unused var
2013-05-18 15:50:12 +02:00
Stephan Groß
e6409bbc83
Temp commit for branch change ;-)
2013-05-18 15:48:36 +02:00
Ryan Kaskel
ef383d969c
Clean up test case.
2013-05-18 14:31:29 +01:00
Craig de Stigter
208bd991da
when source='*' on a nested serializer, expand fields into outer serializer when writing. fixes #765
2013-05-18 15:23:43 +02:00
Ryan Kaskel
22874e441d
Merge latest changes from master.
2013-05-18 14:17:50 +01:00
Stephan Groß
a71acc76d8
Fix for #710
2013-05-18 15:12:54 +02:00
Ryan Kaskel
0b84c5a0ac
Merge latest changes from master.
2013-05-18 14:04:27 +01:00
Pablo Recio
392c8556ae
Display an empty label into related fields if it isn't required
2013-05-18 15:01:58 +02:00
Markus Törnqvist
1343398868
Renderer uses form field's label and help, not attribute name
2013-05-18 15:15:02 +03:00
Mark McArdle
50a8f114fc
Merge branch 'master' of git://github.com/tomchristie/django-rest-framework
2013-05-18 13:12:30 +01:00
Ryan Kaskel
770ed3de2e
ToMany fields default to read-only if targeting ManyToManyField.
2013-05-18 13:11:40 +01:00
Mark McArdle
611919aa0a
Initial commit of fix for https://github.com/tomchristie/django-rest-framework/issues/775
2013-05-18 13:10:05 +01:00
Tom Christie
6d425aa3be
Merge pull request #831 from brianz/master
...
Allow nested fields to be missing
2013-05-18 04:36:00 -07:00
Pablo Recio
8fe43236a2
Moved test model into closer to the testcase
2013-05-18 13:23:38 +02:00
Pablo Recio
53a8004401
Merge branch 'master' into 725-blank-choice-dash
...
Conflicts:
rest_framework/tests/fields.py
2013-05-18 12:51:40 +02:00
Pablo Recio
ab8bd566f9
Adding BLANK_CHOICE_DASH
as a choice if the model's field isn't required
2013-05-18 12:41:52 +02:00
Tom Christie
2a3056d038
Merge pull request #851 from linovia/master
...
Updated the dependencies version and added the ALLOWED_HOSTS for tests.
2013-05-18 03:40:38 -07:00
Pablo Recio
de5cc8de42
A model's field is required if is null or blank
2013-05-18 12:40:25 +02:00
Tom Christie
9fe6a103ec
Merge pull request #694 from craigds/master
...
fix function names and dotted lookups for use in PrimaryKeyRelatedField
2013-05-18 03:38:36 -07:00
Craig de Stigter
c992b600f7
add tests for dotted lookup in RelatedField, PrimaryKeyRelatedField, and HyperlinkedRelatedField. #694
2013-05-18 12:32:48 +02:00
Markus Törnqvist
764299843c
ManyHyperlinkedRelatedField comes form rest_framework.relations now
2013-05-18 13:30:39 +03:00
Tom Christie
a73c16b85f
serializers.Field respects ordering on dicts if it exists. Closes #832
2013-05-18 11:27:48 +01:00
Markus Törnqvist
3691cd2ffd
Use smart_text() instead of nonexistant smart_unicode()
2013-05-18 13:26:59 +03:00
Markus Törnqvist
85faebbb75
Merge branch 'mikee2185-master' into mjtorn-master
...
Conflicts:
rest_framework/fields.py
rest_framework/serializers.py
rest_framework/tests/models.py
rest_framework/tests/serializer.py
Fixed all the conflicts.
2013-05-18 13:24:36 +03:00
Craig de Stigter
930bd4d0e1
add tests for related field source for HyperlinkedRelatedField. #694
2013-05-18 12:23:12 +02:00
Craig de Stigter
0cd7c80e6e
add tests for related field source for RelatedField and PrimaryKeyRelatedField. #694
2013-05-18 12:16:30 +02:00
Xavier Ordoquy
ed0bd195f5
Updated the dependencies version and added the ALLOWED_HOSTS for tests.
2013-05-18 12:07:44 +02:00
Tom Christie
aea040161a
Forms in Broseable API support dynamic serializers based on request method
2013-05-18 09:36:09 +01:00
Craig de Stigter
c56d5f8f63
Merge remote-tracking branch 'upstream/master'
2013-05-18 10:23:26 +02:00
Tom Christie
34776da924
Minor mixin refactoring
2013-05-17 22:09:23 +01:00
Tom Christie
b6fb377c2b
Fix PendingDeprecation warnings in tests
2013-05-17 21:57:11 +01:00
Tom Christie
14ded26167
PendingDeprecation warning to allow_empty
2013-05-17 21:28:33 +01: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
aff88d15f7
Version 2.3.3
2013-05-16 15:08:12 +01:00
Tom Christie
af88a5b175
Test and fix which closes #652 .
2013-05-15 14:25:25 +01:00
Tom Christie
092d5223eb
Fix searchfilter issues
2013-05-15 10:29:51 +01:00
Tom Christie
2f54decd3e
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-05-14 21:41:39 +01:00
Tom Christie
e939e1755a
Base automatic filterset model on the queryset model. Fixes #834 .
2013-05-14 21:40:55 +01:00
Tom Christie
dd3c434f6c
Merge pull request #824 from jsummerfield/patch-1
...
Remove trailing unmatched </div> in login_base.html template. Reformat i...
2013-05-14 10:36:31 -07:00
Tom Christie
d62414147f
Fix assert messaging on fields/exclude checking. Closes #833
2013-05-14 17:53:37 +01:00
Tom Christie
a303d0f38c
Fix filter test renaming
2013-05-14 11:37:59 +01:00
Tom Christie
ce1a04a603
Merge branch 'master' of https://github.com/avinash240/django-rest-framework
2013-05-14 11:34:47 +01:00
Tom Christie
2cff6e69db
Added OrderingFilter
2013-05-14 11:27:08 +01:00
Tom Christie
6a037f63ed
Added OrderingFilter
2013-05-14 11:27:03 +01:00
Tom Christie
08bc976269
Rename filter tests
2013-05-14 10:16:46 +01:00
Tom Christie
b2bf5f1f88
SearchFilter may be comma and/or whitespace seperated
2013-05-14 10:10:44 +01:00
Tom Christie
752c01420f
Fix Django 1.3 compat with routers
2013-05-14 10:01:05 +01:00
Brian Zambrano
24c9c455fe
Allow for missing non-required nested objects.
...
Serializer fields which are themselves serializers should not be required.
Specifically, if a nested object is set to "required=False", it should be
possible to serialize the main object and have the sub-object set to None/null.
2013-05-13 14:41:12 -07:00
James Summerfield
5074bbe4b2
Remove trailing unmatched </div> in login_base.html template. Reformat indentation and label all closing tags for consistency.
2013-05-13 07:51:23 +02:00
Marlon Bailey
5e2d8052d4
fix test case to work with Python 3 and make it more explicit
2013-05-12 09:22:14 -04:00
Marlon Bailey
9d2580dccf
added support for multiple @action and @link decorators on a viewset, along with a router testcase illustrating the failure against the master code base
2013-05-11 22:26:34 -04:00
Tom Christie
fd4a66cfc7
Fix py3k compat with functools.reduce
2013-05-10 23:06:42 +01:00
Tom Christie
dd51d369c8
Unicode string fix
2013-05-10 23:02:24 +01:00
Tom Christie
293dc3e6d8
Added SearchFilter
2013-05-10 22:33:11 +01:00
Tom Christie
8ce36d2bf1
SearchFilter and tests
2013-05-10 21:57:20 +01:00
Tom Christie
773a92eab3
Move models into test modules, out of models module
2013-05-10 21:57:05 +01:00
Tom Christie
0176a5391b
Fix HyperlinkedModelSerializer not respecting lookup_fields
2013-05-09 17:09:40 +01:00
Tom Christie
939cc5adba
Tweak inheritance
2013-05-09 13:35:01 +01:00
Tom Christie
31f94ab409
Added GenericViewSet and docs tweaking
2013-05-09 13:31:42 +01:00
Mark Aaron Shirley
14482a9661
Fix deprecation warnings in relations_nested tests
2013-05-08 22:44:23 -07:00
Mark Aaron Shirley
e550740b3d
Merge remote-tracking branch 'upstream/master' into writable-nested-modelserializer
...
Conflicts:
rest_framework/tests/relations_nested.py
2013-05-08 22:39:48 -07:00
Tom Christie
4ab7b8f257
Version 2.3.2
2013-05-08 20:49:49 +01:00
Tom Christie
b443560080
Fix DATETIME_FORMAT, DATE_FORMAT, TIME_FORMAT settings. Closes #798
2013-05-08 20:38:50 +01:00
Tom Christie
de69a28b9e
Test and fix for #814 .
2013-05-08 20:18:01 +01:00
Tom Christie
429e078eee
Allow None filename on uploaded files
2013-05-08 20:07:51 +01:00
Tom Christie
d7c08222f1
Fix breadcrumb rendering issue
2013-05-07 14:11:48 +01:00
Tom Christie
ed2cf180c9
Version 2.3.0
2013-05-07 13:29:38 +01:00
Tom Christie
3353889ae8
Docs for FileUploadParser
2013-05-07 13:27:27 +01:00
Tom Christie
642970a1b8
Merge pull request #806 from wronglink/master
...
Added FileUploadParser
2013-05-07 05:09:09 -07:00
Tom Christie
3c2bb06660
Support for multiple filter classes
2013-05-07 13:00:44 +01:00
Tom Christie
d71a5533f9
allow_empty -> pending deprecation in preference of overridden get_queryset.
2013-05-07 12:25:41 +01:00
Tom Christie
b70c9cc107
Merge master
2013-05-05 18:12:35 +01:00
Tom Christie
75b2afcb23
Merge branch 'master' into 2.3
2013-05-05 16:48:46 +01:00
Tom Christie
660d240517
.action attribute on viewsets
2013-05-05 16:48:00 +01:00
Tom Christie
538d2e35e7
lookup_field on hyperlink serializers
2013-05-05 16:47:45 +01:00
Michael Elovskikh
a514232815
Raise ParseError if can't handle the uploaded file
2013-05-04 17:18:41 +06:00
Michael Elovskikh
e36e4f48ad
Codebase improvements on FileUploadParser
...
* Added docstrings.
* Added `FileUploadParser.get_filename` to make it easier to override.
* Added url kwargs filename detection step.
* Updated tests corresponding to these changes.
2013-05-04 14:58:21 +06:00
Michael Elovskikh
318fdaabe5
Tests for FileUploadParser
2013-05-03 01:39:08 +06:00
Michael Elovskikh
0c85768435
Added FileUploadParser refs #7
2013-05-03 01:37:25 +06:00
Tom Christie
387250bee4
Automagically determine base_name in router class
2013-05-02 12:07:37 +01:00
Tom Christie
e4067bfb75
introduce lookup_field and add pendingdeprecationwarnings
2013-05-02 12:07:18 +01:00
Victor Shih
8cabae22c5
Example and spelling fixes. Change "browseable" to "browsable" for consistency.
2013-05-01 21:26:40 -07:00
Tom Christie
35f99cddc4
lookup_field on hyperlinked fields, and overriddable hyperlinked fields. Closes #688
2013-05-01 09:03:09 +01:00
Danilo Bargen
e5040fbf94
Catch ImproperlyConfigured exception in compat.py ( fixes #803 )
2013-04-30 23:24:33 +02:00
Tom Christie
22af28d146
Merge master
2013-04-30 19:32:34 +01:00
Tom Christie
b65b065375
Add DjangoModelPermissionsOrAnonReadOnly
2013-04-30 14:34:28 +01:00
Tom Christie
8dff8d2fdc
Add get_breadcrumbs hook to BrowseableAPIRenderer. Closes #733 .
2013-04-30 14:34:03 +01:00
Tom Christie
21ae3a6691
Drop out attribute
2013-04-30 08:24:33 +01:00
Tom Christie
0c1ab584d3
Tweaks for preferring .queryset over .model
2013-04-29 14:08:38 +01:00
Tom Christie
53f9d4a380
fields shortcut on views
2013-04-29 13:20:15 +01:00
Tom Christie
d17e2d852f
Remove AutoRouter. (Adding shortcut to generic views/viewsets means it's unneccessary)
2013-04-29 12:46:57 +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
JC
8cbb715f4c
Changed definition of NestedModelSerializer to correct depth handling
2013-04-27 13:23:55 -07:00
JC
3b0fa3ebaa
Changed DepthTest to have depth=2
2013-04-27 13:10:39 -07:00
Tom Christie
018d8b8dce
Bits of cleanup
2013-04-26 15:11:11 +01:00
Tom Christie
8fa79a7fd3
Deal with List/Instance suffixes for viewsets
2013-04-26 14:59:21 +01:00
Tom Christie
d985aec3c9
DecimalField
2013-04-26 13:59:06 +01:00
Tom Christie
7268a5c571
Added AutoRouter. Don't know if this is a good idea.
2013-04-25 17:41:47 +01:00
Tom Christie
5d01ae661f
Simplify paginate_queryset method
2013-04-25 17:40:17 +01:00
Tom Christie
95abe6e844
Cleanup docstrings
2013-04-25 12:47:34 +01:00
Tom Christie
b94da2468c
Various clean up and lots of docs
2013-04-24 22:40:24 +01:00
Tom Christie
835d3f89d3
Merge remove-django-generics
2013-04-23 11:59:13 +01:00
Tom Christie
4bf1a09bae
Ensure implementation of reverse relations in 'fields' is backwards compatible
2013-04-23 11:31:38 +01:00
Mark Aaron Shirley
7e0a93f0ee
Don't use field when saving related data
2013-04-19 10:46:57 -07:00
Mark Aaron Shirley
fdc5cc3d81
Fix model serializer nestesd delete behavior
2013-04-18 10:28:20 -07:00
forgingdestiny
03c736338f
extend base login template
2013-04-17 10:15:02 -04:00
forgingdestiny
33f494fcc8
add branding and style blocks
2013-04-17 10:14:36 -04:00
Tom Christie
bcf4cb2b4e
Merge branch 'include_reverse_relations' of https://github.com/tomchristie/django-rest-framework into include_reverse_relations
2013-04-17 09:26:34 +01:00
Tom Christie
ea55143a23
Version 2.2.7
2013-04-17 09:07:20 +01:00
Tom Christie
37fe0bf0de
Remove unneccessary tests from #789 , and bit of cleanup.
2013-04-17 09:03:24 +01:00
Tom Christie
700df90da1
Merge https://github.com/shezi/django-rest-framework
2013-04-17 08:51:36 +01:00
Mark Aaron Shirley
c7e000e46e
Merge remote-tracking branch 'upstream/master' into writable-nested-modelserializer
...
Conflicts:
docs/api-guide/serializers.md
2013-04-16 09:55:47 -07:00
Tom Christie
23289b023d
Explicit error if dev does not return a response from the view
2013-04-16 14:32:46 +01:00
Stephan Groß
cac6697025
Return Decimal instance instead of string
2013-04-15 15:24:14 +02:00
Stephan Groß
9d80f01bce
Fix init call
2013-04-15 15:15:55 +02:00
Stephan Groß
c329d2f085
Add DecimalField to field_mapping
2013-04-15 13:11:41 +02:00
Stephan Groß
37f7d8bc0f
Fix unicodes
2013-04-15 13:02:18 +02:00
Stephan Groß
ad436d966f
Add DecimalField support
2013-04-15 13:02:18 +02:00
Johannes Spielmann
750451f5b4
adding test case for generic view with overriden get_object()
2013-04-14 18:30:44 +02:00
Tom Christie
5a5a602f8a
Allow overriding get_object to work correctly. Fixes #784
2013-04-13 20:07:36 +01:00
Tom Christie
e0020c5b03
Simplify get_object
2013-04-11 15:48:18 +01:00
Tom Christie
76e039d70e
First pass on automatically including reverse relationship
2013-04-10 22:38:02 +01:00
Tom Christie
3f91379e4e
Fix 1.3 compat issue. Closes #780
2013-04-10 09:24:24 +01:00
Tom Christie
07af437361
Cleaning up around bits of API that will be pending deprecation
2013-04-09 19:47:16 +01:00
Tom Christie
9bb1277e51
Cleaning up around bits of API that will be pending deprecation
2013-04-09 19:37:19 +01:00
Tom Christie
1de6cff11b
Cleaning up get_object and get_queryset
2013-04-09 19:06:49 +01:00
Tom Christie
dc45bc7bfa
Add lookup_kwarg
2013-04-09 19:01:01 +01:00
Tom Christie
099163f81f
Removed SingleObjectMixin and MultipleObjectMixin
2013-04-09 18:45:15 +01:00
Tom Christie
c73d0e1e39
Minor cleaning up on View
2013-04-09 18:22:39 +01:00
Mark Aaron Shirley
73efa96de9
one-many writable nested modelserializer support
2013-04-06 08:43:21 -07:00
Tom Christie
371698331c
Tweaks
2013-04-04 22:24:30 +01:00
Tom Christie
c2280e34ec
Version 2.2.6
2013-04-04 21:53:15 +01:00
Tom Christie
fd3f538e9f
Fix up view name/description tests
2013-04-04 21:48:23 +01:00
Tom Christie
f68721ade8
Factor view names/descriptions out of View class
2013-04-04 21:42:26 +01:00
Tom Christie
9e24db022c
Commenting
2013-04-04 20:38:42 +01:00
Tom Christie
fb41d2ac8f
Add support for action and link routing
2013-04-04 20:35:40 +01:00
Tom Christie
c785628300
Fleshing out viewsets/routers
2013-04-04 20:00:44 +01:00
glic3rinu
b6c7730d7f
Fixed comma detection in break_long_headers templatetag
2013-04-04 14:01:47 +02:00
glic3rinu
92b5db5939
Added break_long_headers on templatetags and base template
2013-04-04 12:11:04 +02:00
Tom Christie
35b86ee52a
Merge pull request #772 from preed/preed/ModelSerializer-bool-fix
...
Don't have the ModelSerializer trust deserialized objects to not have re...
2013-04-03 04:53:52 -07:00
Atle Frenvik Sveen
80d28de034
Fix the fact that InvalidConsumerError and InvalidTokenError wasn't imported correctly from oauth_provider
2013-04-03 13:10:41 +02:00
Tom Christie
a18d3df0f6
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-04-03 09:21:04 +01:00
Tom Christie
74fbd5ccc5
Fix bug with inactive user accessing OAuth
2013-04-03 09:20:36 +01:00
J. Paul Reed
889558365b
Don't have the ModelSerializer trust deserialized objects to not have redefine bool()ean-ness.
...
If the model we're using the ModelSerializer for has redefined methods that act as a boolean (__bool__ or __len__), it may not return the object even though it is_valid(), and should.
2013-04-02 01:41:40 -07:00
glic3rinu
76d1c47905
Fixed IPv6 support for urlize_quoted_links
2013-04-01 20:15:05 +02:00
Tom Christie
ec076a0078
Add viewsets/routers to indexs etc
2013-03-31 11:36:58 +01:00
Tom Christie
b4945f476c
Merge branch 'master' into resources-routers
2013-03-30 15:41:38 +00:00
Tom Christie
a69262a1cd
Merge pull request #767 from tomchristie/fix-oauth2-token-only
...
Fix OAuth 2 token only
2013-03-29 06:42:24 -07:00
Tom Christie
ff3ebd979d
Merge pull request #766 from glic3rinu/master
...
Refactored urlize_quoted_links based on Dango 1.5 urlize
2013-03-29 06:40:23 -07:00
Kevin Stone
4531ded061
Removed pagination regression special case for Django<1.4. Having DjangoFilterBackend return an actual query set fixes this issue.
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-03-28 18:48:48 -07:00
glic3rinu
9c32f048b5
Cleaned imports on templatetags/rest_framework module
2013-03-28 12:01:47 +01:00
glic3rinu
3774ba3ed2
Added force_text to compat
2013-03-28 12:01:08 +01:00
Kevin Stone
d4df617f8c
Added unit test for failing DjangoFilterBackend on SingleObjectMixin that was resolved in b10663e024
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-03-27 18:29:50 -07:00
Kevin Stone
b10663e024
Fixed DjangoFilterBackend not returning a query set.
...
Fixed bug unveiled in #682 .
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-03-27 17:55:36 -07:00
Pierre Dulac
fa61b2b2f1
Remove oauth2-provider backends reference from compat.py
2013-03-28 01:05:51 +01:00
Pierre Dulac
8ec60a22e1
Remove client credentials from all OAuth 2 tests
2013-03-28 00:57:23 +01:00
Fernando Rocha
b2cea84fae
Complete remove of client checks from oauth2
...
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
2013-03-27 19:00:36 -03:00
glic3rinu
2c0363ddae
Added quotes to TRAILING_PUNCTUATION used by urlize_quoted_links
2013-03-27 22:58:11 +01:00
glic3rinu
5f48b4a77e
Refactored urlize_quoted_links code, now based on Django 1.5 urlize
2013-03-27 22:43:41 +01:00
Fernando Rocha
f1b8fee4f1
client credentials should be optional ( fix #759 )
...
client credentials should only be required on token
request
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
2013-03-27 14:05:46 -03:00
Tom Christie
92c929094c
Version 2.2.5
2013-03-26 07:48:53 +00:00
Tom Christie
7eefcf7e53
Bulk update, allow_add_remove flag
2013-03-25 20:26:34 +00:00
Tom Christie
d97e72cdb2
Cleanup one-one nested tests and implementation
2013-03-25 17:28:23 +00:00
Matteo Suppo
b5640bb778
Forcing translations of lazy translatable strings in Field to_native method
2013-03-23 14:18:55 +01:00
Matteo Suppo
0081d744b9
Added tests for issue 747 in serializer.py
2013-03-23 14:18:11 +01:00
Tom Christie
3f79a9a3d3
one-one writable nested modelserializers
2013-03-22 22:39:45 +00:00
Tom Christie
addf7e9b36
Defer the writable nested modelserializers work
2013-03-22 22:27:03 +00:00
Tom Christie
9bf7c9b714
Merge master
2013-03-22 21:57:37 +00:00
Tom Christie
870d5c7d78
Merge pull request #744 from tomchristie/basic-bulk-edit
...
Basic bulk create and bulk update
2013-03-22 14:47:29 -07:00
Tom Christie
4055129662
If oauth is not attempted don't throw an error. Fixes #748 .
2013-03-22 21:31:50 +00:00
Tom Christie
13794baf70
Bit of extra tidying and plenty of docs
2013-03-22 17:01:06 +00:00
Tom Christie
b4210f9a56
Test moved out of serializer.py into serializer_bulk_update
2013-03-22 12:46:03 +00:00
Tom Christie
c32d9969ac
Add extra tests for errors from incorrect data with multiple create/update
2013-03-22 12:33:09 +00:00
Tom Christie
8adde506e8
Default date/time fields now return python date/time objects again by default
2013-03-21 08:41:54 +00:00
Tom Christie
20fd738c85
iso formated datetime aware fields with +0000 offset should use 'Z' suffix instead
2013-03-20 13:05:59 +00:00
Tom Christie
b2dc664485
Basic bulk create and bulk update
2013-03-19 14:26:48 +00:00
Tom Christie
deb5e653e4
Added bulk create tests
2013-03-18 21:35:06 +00:00
Tom Christie
ad3ffe20f0
Merge branch 'master' into basic-nested-serialization
2013-03-18 21:12:05 +00:00
Tom Christie
09e4ee7ae3
Remove dumbass unneeded test
2013-03-18 21:11:40 +00:00
Tom Christie
922ee61d86
Remove erronous pre_save
2013-03-18 21:05:13 +00:00
Tom Christie
74fb366c59
Merge branch 'master' into resources-routers
2013-03-18 21:03:05 +00:00
Craig de Stigter
101fa26ebc
use writablefield style for serializer handling of self.default
2013-03-18 16:05:34 +13:00
Craig de Stigter
d6d5b1d82a
allow default values in writable serializer fields
2013-03-18 14:50:21 +13:00
Craig de Stigter
c8416df0c4
accept all WritableField kwargs for writable serializers (eg required=True)
2013-03-18 14:27:15 +13:00
Tom Christie
66bdd608e1
Fixes to save_object
2013-03-16 07:35:44 +00:00
Tom Christie
3ff103ad04
Fixes to save_object
2013-03-16 07:35:27 +00:00
Tom Christie
ccf551201f
Clean up and comment restore_object
2013-03-16 07:32:50 +00:00
Tom Christie
56653111a6
Remove unneeded arguments to save_object
2013-03-15 19:57:57 +00:00
Tom Christie
32e0e5e18c
Remove erronous _delete attribute
2013-03-15 19:55:32 +00:00
Tom Christie
47492e3ef4
Clean out ModelSerializer special casing from Serializer.field_from_native
2013-03-15 19:22:31 +00:00
Tom Christie
fb3b57803f
one 2 one nested relationships
2013-03-15 19:17:54 +00:00
Mark Aaron Shirley
3006e3825f
One-to-one writable, nested serializer support
2013-03-14 15:17:13 -07:00
Tom Christie
acc8c1faa4
force_insert, force_update arguments. Closes #484 .
...
Confirmed by `assertNumQueries(…)` in tests.
2013-03-13 20:40:39 +00:00
Tom Christie
4b68089d44
Version 2.2.4
2013-03-13 13:07:46 +00:00
Tom Christie
76bf8db83a
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-03-13 12:48:27 +00:00
Tom Christie
73ab7dc3f1
Use django-filter 0.6a1 and add database query count tests for paginated, filtered lists.
2013-03-13 12:45:54 +00:00
Tom Christie
a798a5350a
Fix duplicated database queries for paginated lists.
...
Closes #713 .
2013-03-13 11:42:12 +00:00
Tom Christie
126cadf27e
Merge branch 'num-query-checking' of https://github.com/mjtamlyn/django-rest-framework
2013-03-13 11:36:55 +00:00
Tom Christie
0cf94cbd8b
Merge pull request #723 from mjumbewu/multitable-inheritance
...
Use parent's primary key when model is derived via multitable inheritance
2013-03-12 13:56:34 -07:00
Tom Christie
377dc2cda2
Only honor X-HTTP-Method-Override for POST requests.
2013-03-12 20:49:20 +00:00
Tom Christie
716d86863f
Merge pull request #695 from kuhnza/master
...
Support for X-HTTP-Method-Override Header
2013-03-12 13:40:48 -07:00
Tom Christie
b6b686d285
Merge branch 'master' into basic-nested-serialization
2013-03-12 20:30:14 +00:00
Tom Christie
043d748b53
Tweak
2013-03-12 20:12:28 +00:00
Tom Christie
f513db714d
Clean up TokenHasReadWriteScope slightly
2013-03-12 19:07:30 +00:00
Tom Christie
e8db504a98
Merge master
2013-03-12 18:49:38 +00:00
Tom Christie
2f1951910f
Descriptive text for NestedValidationError
2013-03-12 18:35:20 +00:00
Tom Christie
d8c5dca9ae
Extra tests for nested serializers
2013-03-12 18:34:52 +00:00
Tom Christie
6b4bb48dd4
Initial support for writable nested serialization (Not ModelSerializer)
2013-03-12 13:33:02 +00:00
Dave Kuhn
2e481f3318
Added test for X-HTTP-Method-Override header
2013-03-12 12:00:41 +11:00
Mjumbe Wawatu Ukweli
bd3fe75e1a
Further group model inheritance tests
2013-03-11 17:32:32 -04:00
Mjumbe Wawatu Ukweli
354fbc64ba
Group the model-inheritance-related tests together
2013-03-11 17:28:55 -04:00
Mjumbe Wawatu Ukweli
bdcecf48e3
Simplify inherited child check to not use isinstance
2013-03-11 16:01:19 -04:00
Mjumbe Wawatu Ukweli
e7e470739f
Use parent's primary key when model is derived via multitable inheritance
2013-03-11 03:23:44 -04:00
Bouke Haarsma
126a0f739d
Fixed #720
2013-03-10 21:02:34 +01:00
Bouke Haarsma
3cd3235881
Failing test to show problem of #720
2013-03-10 21:01:51 +01:00
Pierre Dulac
eec8efafc3
Add the implementation for TokenHasReadWriteScope permissions w/ oauth 1
2013-03-10 14:40:20 +01:00
Pierre Dulac
e03906a5c4
Add TokenHasReadWriteScope class for permissions based on scopes
2013-03-10 14:08:29 +01:00
Tom Christie
239758e034
Serializers support bulk create.
2013-03-09 10:21:53 +00:00
Tom Christie
69d169f5f6
Neater override hooks and more docs for DjangoModelPermissions.
...
Refs #702 .
2013-03-08 23:42:20 +00:00
Tom Christie
fd9d6c664b
Fix crazy typo.
2013-03-08 23:08:55 +00:00
Tom Christie
5e993f3929
Merge
2013-03-08 23:00:23 +00:00
Tom Christie
2596c12a21
Fixes for auth header checking.
2013-03-08 22:56:24 +00:00
Tom Christie
28ae26466e
Py3k fixes.
2013-03-08 22:43:46 +00:00
Tom Christie
68683b2ea2
Tweak implementation, and use FormSet style errors
2013-03-08 22:19:09 +00:00
Tom Christie
53b58a5059
Merge branch 'master' of https://github.com/bitmonkey/django-rest-framework into list-deserialization
2013-03-08 21:20:52 +00:00
Tom Christie
c5b98f0d10
authtoken abstract if not installed.
...
Fixes #705 .
2013-03-08 20:56:30 +00:00
Tom Christie
650d8e6a8e
More bits of cleanup
2013-03-08 20:23:25 +00:00
Marc Tamlyn
332c99748f
Add some simple numQueries tests.
2013-03-08 17:36:43 +00:00
Marc Tamlyn
a91dca178d
Correcy typo.
2013-03-08 17:01:43 +00:00
toran billups
1a8f07def8
GenericAPIView now applies filter_backend for list and retrieve api views
...
Before this commit only the MultipleObjectAPIView would apply a
filter_backend, leaving the SingleObjectAPIView to return objects you
might otherwise expect to have been filtered out.
It's worth mentioning that when a SingleObjectAPIView makes a request
for an object that should be excluded, a 404 is the expected result.
2013-03-08 10:08:53 -06:00
Ian Dash
66605acaf0
Errors during deserializing lists now return a list of tuples with
...
index of bad item in data plus usual errors dict
2013-03-08 15:08:05 +00:00
Tom Christie
a4b33992a5
Merge OAuth2 work.
2013-03-07 17:43:13 +00:00
Tom Christie
1d62594fa9
Clean ups.
2013-03-07 15:44:36 +00:00
Tom Christie
44930f3091
Fix Py3k syntax errors
2013-03-07 09:15:05 +00:00
Tom Christie
4e80541824
Version 2.2.3
2013-03-07 09:05:13 +00:00
Tom Christie
ad336cc636
Fix broken None
value for TimeField
.
...
Refs #707 .
2013-03-07 09:03:53 +00:00
Tom Christie
d4e3610e71
Merge & clean OAuth support
2013-03-07 09:01:53 +00:00
Kevin Stone
2f8d8b499e
Patched DateField and DateTimeField to check for None values before trying to perform date(time) conversion.
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-03-06 15:16:37 -08:00
Kevin Stone
6bea275de8
Added failing test cases for giving a DateField or DateTimeField a None value to serialize.
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-03-06 15:15:19 -08:00
Pierre Dulac
8845c0be88
Fix import errors
2013-03-06 22:42:09 +01:00
Pierre Dulac
cda21a306e
Only add the django-oauth2-provider apps if the module is installed
...
otherwise log a warning
2013-03-06 19:16:13 +01:00
Tom Christie
cdf7c778d8
Version 2.2.2
2013-03-06 12:29:56 +00:00
Tom Christie
1106596c80
Clean ups to datetime formatting
2013-03-06 12:19:39 +00:00
Tom Christie
c20ebe95f6
Merge datetime formats
2013-03-05 17:50:28 +00:00
Stephan Groß
214e201ff8
Update migration
2013-03-04 17:12:02 +01:00
Stephan Groß
27175c2cf5
Update migration
2013-03-04 17:04:55 +01:00
Stephan Groß
d6391359f5
Fix fix migrate authtoken
2013-03-04 14:04:03 +01:00
Stephan Groß
4cdb6b2959
Fix authtoken migration
2013-03-04 13:53:39 +01:00
Dave Kuhn
104614c600
Modified to allow form overloading to take precedence over header.
2013-03-04 07:14:38 +11:00
Pierre Dulac
c449dd4f4d
Properly fail to wrong Authorization token type
2013-03-02 20:17:14 +01:00
Pierre Dulac
8809c46ab5
Add new OAuth2 tests
2013-03-02 20:16:18 +01:00
Dave Kuhn
9dccbcbb38
Support for X-HTTP-Method-Override header
2013-03-03 00:23:32 +11:00
Pierre Dulac
721dc519ec
Use django.utils to import the unittest module
...
for a cross python versions compatibility
2013-03-01 23:27:47 +01:00
Stephan Groß
5e5cd6f7f7
Fix for django 1.3 compatibility
2013-03-01 17:15:39 +01:00
Stephan Groß
681ad6f537
Add none testcases to date, datetime, time
2013-03-01 17:04:30 +01:00
Stephan Groß
12905449a5
Add format class attributes
2013-03-01 16:59:47 +01:00
Stephan Groß
9c964cf37b
Add new ISO8601 setting + integration
2013-03-01 16:50:18 +01:00
Stephan Groß
a9d36d4726
Add docs update - part 1
2013-03-01 16:50:18 +01:00
Stephan Groß
f208d8d2bb
Add drf settings + output format + testcases
2013-03-01 16:50:18 +01:00
Stephan Groß
ef5752f8b5
Fix for python 3 support
2013-03-01 16:48:20 +01:00
Stephan Groß
b2165cc76a
Fix for python 3 support - thanks @Linovia
2013-03-01 16:48:20 +01:00
Stephan Groß
9157db5da0
Add better date / datetime validation (pull 2)
...
addition to #631 with update to master + timefield support
2013-03-01 16:48:20 +01:00
Pierre Dulac
d4c2267187
Clean up some print and comments
2013-03-01 12:08:28 +01:00
Pierre Dulac
9d5c306038
Improve the django-oauth2-provider
import block
...
to avoid naming collision with `oauth2` used for OAuth 1
2013-03-01 11:53:30 +01:00
Pierre Dulac
aed3c13471
Merge branch 'master' into oauth2-authentication
...
Conflicts:
rest_framework/tests/authentication.py
2013-03-01 11:50:11 +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
Pierre Dulac
da9d7fb8ec
Add the OAuth2Authentication class
2013-03-01 02:08:58 +01:00
Pierre Dulac
4e1f77db1a
Add django-oauth2-provider to the installed apps
2013-03-01 02:07:53 +01:00
Pierre Dulac
468b5e43e2
Add tests for OAuth2 authentication
2013-03-01 02:06:20 +01:00
Tom Christie
13b3af0d22
Auth is no longer lazy. Closes #667 .
...
More consistent auth failure behavior.
2013-02-28 17:58:58 +00:00
Tom Christie
4e14b26fa9
Drop unused import
2013-02-28 13:42:08 +00:00
Tom Christie
183d3ec6a4
Move ModelSerializer field_mapping into an attribute for easier overriding.
2013-02-28 13:41:42 +00:00
Tom Christie
02ee6e5bf0
Fix out of date docstrings. Closes #689 .
2013-02-27 22:15:28 +00:00
Tom Christie
a1dbd93f54
assertEquals
-> assertEqual
2013-02-27 21:15:00 +00:00
swistakm
55ea5b9460
import compat version of unittest
2013-02-27 10:58:13 +01:00
swistakm
a4304458f5
runtest.settings fixed if django-oauth-plus or oauth2 are not installed
...
oauth_provider can be added to INSTALLED_APPS only if these packages are installed
2013-02-26 11:27:06 +01:00
swistakm
d84c2cf275
OAuth tests now are skipped unless django-oauth-plus and oauth2 are installed.
2013-02-26 11:25:27 +01:00
swistakm
59a6f5f463
Move oauth2 and django-oauth-plus imports to compat and fix some minor issues
...
- alias oauth2 as oauth
- remove rouge print
- remove docstring markups
- OAuthAuthentication.authenticate() now returns (user, token) two-tuple on success
- don't set request.user because it's already set
2013-02-26 11:22:21 +01:00
Danilo Bargen
e476dcb8c7
Changed AttributeError to AssertionError
2013-02-26 09:38:57 +01:00
Danilo Bargen
ec4d79bcaf
Show class name in exception message
2013-02-25 23:02:42 +01:00
Danilo Bargen
3e6f99e273
Improved exception message for missing serializer model meta option
2013-02-25 22:34:05 +01:00
swistakm
1aed9c1604
add OAuthAuthentication class
2013-02-25 16:58:16 +01:00
swistakm
ced22db7cf
add django-oauth-plus & oauth2 to installed apps in runtests settings.py
2013-02-25 16:57:45 +01:00
swistakm
1062d71f8b
add tests for OAuth authentication
2013-02-25 16:56:14 +01:00
Omer Katz
c2c12858e5
Replaced status numbers with the statuses constants from the status model.
2013-02-25 16:59:40 +03:00
Omer Katz
62be5470b3
Fixed misspelled remark in comments.
2013-02-25 16:48:21 +03:00
Omer Katz
3221a088ab
Fixed misspelled remark in comments.
2013-02-25 16:47:47 +03:00
Omer Katz
c05340c91b
Fixed misspelled remarks in comments.
2013-02-25 16:47:07 +03:00
Omer Katz
cc13e95d5e
Fixed misspelled remark in comments.
2013-02-25 16:44:44 +03:00
Omer Katz
8d806d0cef
Fixed misspelled remark in comments.
2013-02-25 16:44:19 +03:00
Tom Christie
e1f0001f92
Fix and test for #645
...
Yuck, pickle is weird. Closes #645 .
2013-02-22 23:00:07 +00:00
Tom Christie
9f98455362
Formatting
2013-02-22 23:00:07 +00:00
Tom Christie
26ba11101b
Merge pull request #669 from yprez/datetimefield_fail
...
DateTimeField validation with non-str value
2013-02-22 14:15:57 -08:00
Tom Christie
bba918fb2a
Fix and test case for #653
...
Closes #653
2013-02-22 22:13:06 +00:00
Tom Christie
bc87bf13b4
Tests and fix for #666 .
...
Closes #666 .
2013-02-22 22:02:42 +00:00
Tom Christie
d44eb20942
Version 2.2.1
2013-02-22 20:47:41 +00:00
Tom Christie
3357a36e37
assert package requirements are met for YAMLRenderer
2013-02-22 20:46:43 +00:00
Tom Christie
0c7d6062b2
Py3/2 compat fixes for uncode view names/descriptions
2013-02-22 20:18:16 +00:00
Tom Christie
09f2bdd219
Added test for utf8 strings in docstrings of views.
2013-02-22 20:17:47 +00:00
Tom Christie
78da724964
Merge with master
2013-02-22 19:48:25 +00:00
Tom Christie
a39de47cc7
XML cleanup
2013-02-22 19:46:47 +00:00
Tom Christie
569c3a28e6
Add forbid_dtd flag, since we don't need any DTDs.
2013-02-22 19:41:09 +00:00
Tom Christie
3ad5ebaea6
Fix name fallback for BrowsableAPIRenderer
2013-02-22 13:38:20 +00:00
Tom Christie
44b59969ce
Merge pull request #672 from wronglink/unicode__doc__
...
Fixed UnicodeDecodeError on get_name and get_description methods
2013-02-22 05:37:15 -08:00
Tom Christie
dcee027fa9
defusedxml for security fix.
...
As per:
http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html
2013-02-22 13:17:22 +00:00
Michael Elovskikh
aa95ccbab7
Fixed UnicodeDecodeError on get_name and get_description methods
2013-02-22 18:50:09 +06:00
Tom Christie
b261515afa
XML cleanup
2013-02-22 12:36:52 +00:00
Michael Elovskikh
7b9e134a8f
Minimal appearance fixes in addition to #663
2013-02-22 17:49:10 +06:00
Tom Christie
048ef6a039
Polishing touches to #663
2013-02-22 08:39:26 +00:00
Yuri Prezument
5f531fc1ea
Catch TypeError as well as ValueError when parsing dates, ref #699
2013-02-21 15:54:31 +02:00
Yuri Prezument
8fa82822a0
Add assertion in test
2013-02-21 15:39:14 +02:00
Yuri Prezument
1b4c078db2
Failing test case for #669
2013-02-21 12:22:09 +02:00
Tom Christie
03afaee423
Merge branch 'browsable_api_patch' of https://github.com/wronglink/django-rest-framework into generic-form-input
2013-02-20 12:18:57 +00:00
Michael Elovskikh
2fb6fa2dd3
Minimal forms appearance improvements
2013-02-20 17:15:12 +06:00
Tom Christie
160d10d348
Fix docstring
2013-02-20 08:46:00 +00:00
Michael Elovskikh
533e472352
Added tabs between object form and generic content form on POST form
2013-02-15 18:25:36 +06:00
Michael Elovskikh
3195f72784
POST form using new form.html template
2013-02-15 16:39:24 +06:00
Michael Elovskikh
d3f6536365
Added tests for PATCH form in the Browsable API
2013-02-15 15:44:11 +06:00
Tom Christie
367909e2c2
Merge pull request #657 from dgaus/master
...
Make is_simple_callable consider default arguments
2013-02-15 01:13:14 -08:00
Tom Christie
6dd867c8fe
Merge pull request #660 from pelme/timefield
...
Added a serializer TimeField
2013-02-15 01:12:03 -08:00
Tom Christie
c1a40c5899
Drop unused import.
2013-02-15 09:06:05 +00:00
Michael Elovskikh
8fdf925015
Added tabs between object form and generic content form on PUT/PATCH form
...
Some extra behaviour to `BrowsableAPIRenderer` to handle PATCH form.
Added PATCH button on generic content PUT form.
Tabs between object form and generic content form on PUT/PATCH form wich are
both allways visible now.
Fix #570
Refs #591
2013-02-15 14:41:12 +06:00
Andreas Pelme
5a5df18d18
Added a serializer TimeField
2013-02-14 21:19:51 +01:00
Tom Christie
af686ec11a
request.DATA should use empty QueryDict for no data, not None.
2013-02-14 13:02:28 +00:00
Tom Christie
9d3153ed04
Fix broken clone_request
2013-02-14 12:50:55 +00:00
Tom Christie
24ed0fa4b9
Drop accidental (uneeded) validation logic.
2013-02-14 12:26:02 +00:00
Diego Gaustein
40b13a869b
Make is_simple_callable consider fields which have default arguments
2013-02-13 20:34:23 -03:00
Tom Christie
f17bae8aac
Version 2.2.0
2013-02-13 14:05:57 +00:00
Tom Christie
72412b69f0
Set PASSWORD_HASHERS to massively speed up tests (almost x10)
2013-02-13 12:36:05 +00:00
Tom Christie
b58e763287
Fix pk relations tests which were not running.
2013-02-13 12:33:04 +00:00
Tom Christie
d7417022f3
Kick travis again.
2013-02-13 11:51:03 +00:00
Tom Christie
31f45907e5
Kick travis. Meh.
2013-02-13 11:42:57 +00: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
f341ead499
Test for None in 'dotted.source' component.
...
Closes #643 .
2013-02-12 23:01:20 +00:00
Tom Christie
15fa42b647
Unicode literal fix
2013-02-12 23:00:43 +00:00
Tom Christie
f505b2e440
Clean up field_to_native logic
2013-02-12 22:59:01 +00:00
Tom Christie
724906c516
Test for #637 .
2013-02-12 22:58:38 +00:00
Tom Christie
7f797abc19
Remove deprecated APIs from tests
2013-02-12 20:07:35 +00:00
Tom Christie
41ac1e8f32
Raise warnings if 'request' not in context for hyperlinked fields.
2013-02-12 13:54:50 +00:00
Tom Christie
388e617366
Raise warnings on implicit many serialization
2013-02-12 13:53:45 +00:00
Tom Christie
23fbbb1e16
Drop six
module from coverage.
2013-02-12 08:58:29 +00:00
Tom Christie
f5a0275547
Tidy up internal view permission checking logic.
...
Also document correctly - these methods are now public and will fall
under the deprecation policy from now on.
2013-02-12 08:58:28 +00:00
Tom Christie
09b01887f2
New style object-level permission checks
2013-02-12 08:58:28 +00:00
Tom Christie
aa03425c09
Merge pull request #651 from fernandogrd/master
...
DictWithMetadata.__getstate__ was never called (Fix for 645)
2013-02-11 23:27:35 -08:00
Fernando Rocha
ea004b5e7a
Make use o issubclass instead of isinstance (fix issue #645 )
...
Because __mro__ is a list of classes and not instances.
DictWithMetadata.__getstate__ was never called
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
2013-02-11 19:18:22 -03:00
Tom Christie
baacdd821f
Add object permissions tests.
2013-02-10 20:08:46 +00:00
Tom Christie
870f10486c
Fix incorrect 401 vs 403 response, if lazy authentication has not taken place.
2013-02-10 20:08:36 +00:00
Tom Christie
29136ef2c6
Enforce PUT-as-create permissions
2013-02-10 16:50:46 +00:00
Tom Christie
69dcf13da9
Bugfix for DjangoModelPermissions. Fixes #437
...
Turns out that Django's default permissions backend always returns
False when checking object-level permissions, even if the user does
have valid global permissions.
2013-02-10 16:43:52 +00:00
Tom Christie
4c8bd40465
Tests for DjangoModelPermissions.
2013-02-10 16:42:24 +00:00
Tom Christie
670ac25b25
Allow serializers to handle dicts as well as objects. Fixes #447 .
2013-02-07 12:57:40 +00:00
Tom Christie
8113d66126
Use new style of required=<bool>
not blank
or null
2013-02-07 09:24:34 +00:00
Tom Christie
5813a09512
Use new many=True relations style.
2013-02-07 09:14:58 +00:00
Tom Christie
c18fb0d695
Added a post_save
hook. Closes #558 .
2013-02-06 21:28:03 +00:00
Tom Christie
123c6cbc7c
Merge pull request #640 from mjtamlyn/remove-naked-excepts
...
Purge naked excepts.
2013-02-06 05:21:01 -08: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
55fd646631
Set many explicitly from mixins. Refs #564 .
2013-02-06 13:04:11 +00:00
Tom Christie
4788c87b76
Fix mismatch between template blocks and docs.
...
Fixes #639 .
2013-02-06 12:35:05 +00:00
Tom Christie
efb798cebc
Don't deprecate 'exclude'
...
Need to track outcome of Django's #19733 , and decide on approach
accordingly.
2013-02-06 08:48:41 +00:00
Tom Christie
7dc4bce4e2
Fix 2.6 compat
2013-02-04 21:35:47 +00:00
Tom Christie
937ef00808
Merge branch 'master' into 2.2
2013-02-04 21:19:11 +00:00
Tom Christie
221e77d357
Fix incorrect test name. Fixes #635
2013-02-04 21:18:54 +00:00
Tom Christie
0a38bc9db8
Deal with parser encodings properly
2013-02-04 21:16:34 +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
97f2b99495
Don't use deprecated xml style
2013-02-04 19:51:50 +00:00
Tom Christie
2c634c0e5c
Use request.QUERY_PARAMS internally
...
(instead of request.GET)
2013-02-04 19:51:31 +00:00
Tom Christie
00752dcd2a
Py3k cleanup
2013-02-01 15:07:51 +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
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
9a4d01d687
Formatting fixes
2013-01-30 12:41:26 +00:00
Tom Christie
4601487248
Use many=True style for pk relations.
2013-01-30 12:41:18 +00:00
Fernando Rocha
41364b3be0
Added regretion test for issue #632
...
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
2013-01-30 09:22:36 -03: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
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
Michael Elovskikh
cb5cc70cba
Login page styles fix. Closes #618 . Made with 🍪
2013-01-28 18:01:44 +06:00
Tom Christie
b5d8f50f9d
Merge branch 'master' into many-fields
2013-01-26 21:37:43 +00:00
Tom Christie
a75db4cfb8
Version 2.1.17
2013-01-26 20:59:15 +00:00
Tom Christie
4d43e9f7de
Test for custom pagination serializers. Also refs #604 .
2013-01-26 20:55:09 +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
Tom Christie
b783887c33
Test for GFK, using RelatedField. Refs #607 .
2013-01-25 14:36:27 +00:00
Tom Christie
b73d7e9bb4
Cleaning up GFK test module. Refs #607 .
2013-01-25 13:58:19 +00:00
Tom Christie
d6628d4e78
Test for #552 .
2013-01-24 08:58:19 +00:00
Tom Christie
4a4fe60e33
Merge pull request #603 from minddust/validation_error
...
Add failed testcase for fieldvalidation + fix
2013-01-23 01:21:26 -08:00
Tom Christie
b7abf14d3a
Pass PaginationSerializer context through to child ModelSerializer on init. Fixes #595 . Fixes #552 .
2013-01-23 07:38:13 +00:00
Stephan Groß
69e62457ef
Improve validate_<fieldname> fix
2013-01-23 07:53:54 +01:00
Stephan Groß
f0071dbccd
Add separate test for failed custom validation
2013-01-23 07:52:56 +01:00
Tom Christie
b7ab2aee46
Merge branch 'master' into unauthenticated_response
...
Conflicts:
docs/api-guide/authentication.md
2013-01-22 09:11:38 +00:00
Tom Christie
65b62d64ec
WWW-Authenticate responses
2013-01-21 21:29:49 +00:00
Tom Christie
778b0dddef
Merge pull request #602 from kevinastone/master
...
TestCase for `format_suffix_patterns`
2013-01-21 09:51:33 -08:00
Tom Christie
98bffa68e6
Don't do an inverted if test.
2013-01-21 17:42:39 +00:00
Kevin Stone
e7916ae0b1
Tweaked some method names to be more clear and added a docstring to the test case class.
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-01-21 09:37:50 -08:00
Stephan Groß
2250ab6418
Add possible solution for field validation error
2013-01-21 12:50:39 +01:00
Stephan Groß
dc1c57d595
Add failed testcase for fieldvalidation
2013-01-21 12:45:30 +01:00
Kevin Stone
71bd2faa79
Added test case for format_suffix_patterns to validate changes introduced with issue #593 .
...
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
2013-01-20 13:03:38 -08:00
Tom Christie
771821af7d
Include kwargs in included URLs
2013-01-19 18:39:39 +00:00
Tom Christie
69083c3668
Drop print statement
2013-01-19 18:36:25 +00:00
Tom Christie
2c05faa52a
format_suffix_patterns
now support include
-style nested URL patterns. Fixes #593
2013-01-19 16:56:48 +00:00
Tom Christie
37d49429ca
Raise assertion errors if @api_view decorator is applied incorrectly. Fixes #596 .
2013-01-19 15:51:14 +00:00
Tom Christie
a98049c5de
Drop unneeded test
2013-01-19 15:25:32 +00: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
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
8e5003a1f6
Update errant test comment
2013-01-16 16:04:20 -08:00
Mark Aaron Shirley
46eea97380
Update one-to-one test names
2013-01-16 16:04:19 -08:00
Mark Aaron Shirley
e66eeb4af8
Remove commented out debug code
2013-01-16 16:04:19 -08:00
Mark Aaron Shirley
72c04d570d
Add nested create for 1to1 reverse relationships
2013-01-16 16:04:19 -08:00
Tom Christie
eb3d4d0e93
Drop bits of relations_slug tests which don't mirror existing tests.
2013-01-16 14:32:51 +00:00
Tom Christie
875841c76a
Merge branch 'master' of https://github.com/steve-gregory/django-rest-framework into slug-field-fixes
2013-01-16 13:24:09 +00:00
Tom Christie
4a7139e41d
Tweaks
2013-01-15 21:49:24 +00:00
Steven Gregory
87029122c2
Added a new file 'relations_slug.py' that tests Nullable Foreign Keys and the SlugRelatedField
2013-01-15 13:49:48 -07:00
Tom Christie
71e55cc4f6
Merge with latest master
2013-01-15 17:53:24 +00:00
Tom Christie
52847a215d
Fix implementation
2013-01-15 17:50:51 +00:00
Tom Christie
685706ff2b
Merge pull request #584 from radiosilence/master
...
Adding timedelta support to JSONEncoder, and an example of how to add decode support to a serializer.
2013-01-15 05:25:24 -08:00
James Cleveland
4fc3b1ba56
Add timedelta encoder to the JSONEncoder class.
...
Whilst this commit adds *encoding* of timedeltas to a string of a floating
point value of the seconds, you must add your own serializer field for
whatever timedelta model field you are using. This is because Django doesn't
support any kind of timedelta field out-of-the-box, so you have to either
implement your own or use django-timedelta.
If this is the case and you want to serialise timedelta input, you will have
to implement your own special field to use for the timedelta, which is not
included in core as it is based on a 3rd party library. Here is an example:
import datetime
import timedelta
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from rest_framework.fields import WritableField
class TimedeltaField(WritableField):
type_name = 'TimedeltaField'
form_field_class = forms.FloatField
default_error_messages = {
'invalid': _("'%s' value must be in seconds."),
}
def from_native(self, value):
if value in validators.EMPTY_VALUES:
return None
try:
return datetime.timedelta(seconds=float(value))
except (TypeError, ValueError):
msg = self.error_messages['invalid'] % value
raise ValidationError(msg)
Which is based on the FloatField. This field can then be used in
your serializer like this:
from yourapp.fields import TimedeltaField
class YourSerializer(serializers.ModelSerializer):
duration = TimedeltaField()
2013-01-15 13:08:52 +00:00
Johannes Spielmann
e67b23f1ac
correcting template: closing tag was missing
2013-01-15 13:46:41 +01:00
Tom Christie
da6b9576c5
Update docstrings
2013-01-15 10:51:10 +00:00
Tom Christie
191135d7b0
Version 2.1.16
2013-01-14 09:20:44 +00: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
Juan Riaza
268f60999c
unused imports
2013-01-10 15:48:22 +01: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
431ced66e4
Merge pull request #566 from mjtamlyn/patch-1
...
ObtainAuthToken pluggable Serializer.
2013-01-08 07:38:18 -08:00
Tom Christie
37a8458687
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-01-08 15:05:34 +00:00
Tom Christie
c1f194b0a5
Fix inconsistent view_name logic. Fixes #567 .
2013-01-08 15:03:14 +00:00
Marc Tamlyn
49cd5e59a8
ObtainAuthToken pluggable Serializer.
...
It should have serializer_class in the same way as any other API view.
2013-01-08 12:20:01 +00:00
Mark Aaron Shirley
a897eb5480
Create separate *NullableOneToOneTests TestCase
2013-01-07 16:27:31 -08:00
Xavier Ordoquy
510d6a3c55
Introduced HTTP_HEADER_ENCODING.
2013-01-07 23:26:14 +01:00
Tom Christie
4e8f55887d
Clean up test slightly. Refs #552
2013-01-07 21:37:44 +00:00
Tom Christie
4bb504732d
Respect blank=True on relational fields. Fixes #537
2013-01-07 21:08:55 +00:00
Tom Christie
36fa722ebb
Merged to latest master
2013-01-07 21:04:52 +00:00
Marc Tamlyn
5bded1ecf0
Use ResolveMatch.view_name so namespaces work.
2013-01-07 14:34:45 +00:00
Marc Tamlyn
c736b80290
Be more informative when reporting import errors.
2013-01-07 12:52:20 +00:00
Michael Mior
9b67a33b92
Use the correct static template tag in Django 1.5
2013-01-06 15:49:12 -05:00
Juan Riaza
a061e3d9e2
deprecate simplejson
2013-01-05 13:40:02 +01: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
eb14278a3b
Add proper validation for updating relational fields with incorrect types. Fixes #446 .
2013-01-04 13:50:40 +00:00
Tom Christie
4c86fd46d7
Rename module for basic relational field tests
2013-01-04 13:05:31 +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
ad671022e1
Version 2.1.15
2013-01-03 22:14:11 +00:00
Tom Christie
7ed81c3c66
Tweak comment.
2013-01-03 22:06:55 +00:00
Tom Christie
6da21fa796
Merge pull request #541 from yprez/default_and_partial_serializers2
...
Fix "default" values and partial serializers. Fixes #532 .
2013-01-03 14:05:36 -08:00
Tom Christie
bfea7f64ee
Tweak behavior of hyperlinked fields that include an explicit format suffix.
2013-01-03 21:49:29 +00:00
Tom Christie
92ae08207a
Drop unused private save_m2m flag
2013-01-03 21:49:01 +00:00
Xavier Ordoquy
06ae47752f
Also use the compat module in that file.
2013-01-03 12:49:57 +01:00
Xavier Ordoquy
60250f22c8
Move the various compat things to the compat module.
2013-01-03 11:41:07 +01:00
Xavier Ordoquy
cf51dcc9bb
Straight import is enough.
2013-01-03 10:48:43 +01:00
Mark Aaron Shirley
8fd1f09dad
Move relation tests models into models.py
2013-01-03 10:23:13 +01:00
Yuri Prezument
3f5e938247
Some cleanup
2013-01-03 08:28:17 +02:00
Yuri Prezument
f2625fc38c
FileField validation - handle case when files=None, fixes #542
2013-01-02 22:12:26 +02:00
Yuri Prezument
1c8fccfdcd
Regression test for #542
2013-01-02 22:07:23 +02:00
Xavier Ordoquy
4b77b3c5ad
Move the urlparse lib compatibility to the compat file.
2013-01-02 19:06:55 +01:00
Xavier Ordoquy
c95fa81cb2
Use new exception style
2013-01-02 19:06:28 +01:00
Xavier Ordoquy
9c7524fc33
Fixed unicode errors.
2013-01-02 19:06:02 +01:00
Xavier Ordoquy
45d48dd52f
urlparse not used here.
2013-01-02 18:54:55 +01:00
Tom Christie
6da9cd5429
Add .patch()
method for RetrieveUpdateAPIView
2013-01-02 17:43:43 +00:00
Xavier Ordoquy
1e6927b40d
Merge remote-tracking branch 'reference/py3k' into p3k
2013-01-02 16:17:07 +01:00
Xavier Ordoquy
737349d238
Merge remote-tracking branch 'reference/py3k' into p3k
2013-01-02 16:09:21 +01:00
Yuri Prezument
3873bc8a85
Add explaining comment
2013-01-02 15:57:00 +02:00
Yuri Prezument
6b962cfcf7
Fix "default" and partial serializers, fixes #532
2013-01-02 15:56:46 +02:00
Tom Christie
ef73160599
Added RetrieveUpdateAPIView
2013-01-02 13:46:19 +00:00
Tom Christie
b807f3d52a
Keep API backwards compatible.
2013-01-02 13:39:24 +00:00
Tom Christie
eff40391fb
Merge branch 'patch-support' of https://github.com/ahankinson/django-rest-framework into patch
2013-01-02 13:27:00 +00:00
Mark Aaron Shirley
44771e81b2
Update HyperlinkedForeignKeyTests to match PKForeignKeyTests
2013-01-01 17:51:39 +01:00
Andrew Hankinson
389ca3b3b1
Merge branch 'master' of git://github.com/tomchristie/django-rest-framework into patch-support
2013-01-01 11:36:23 -05:00
Mark Aaron Shirley
a617a3758f
Don't persist relation changes in ModelSerializer#restore_object()
2012-12-31 14:33:24 +01:00
Tom Christie
eff833b39d
Version 2.1.14
2012-12-31 08:53:49 +00:00