Paul Melnikow
3cd15fb171
Router: Do not automatically adjust lookup_regex when trailing_slash is True
...
BREAKING CHANGE
When trailing_slash is set to True, the router no longer will adjust the lookup regex to allow it to include periods. To simulate the old behavior, the programmer should specify `lookup_regex = '[^/]+'` on the viewset.
https://github.com/tomchristie/django-rest-framework/pull/1328#issuecomment-31517099
2014-01-04 16:57:50 -05:00
Paul Melnikow
a1d7aa8f71
Allow viewset to specify lookup value regex for routing
...
This patch allows a viewset to define a pattern for its lookup field, which the router will honor. Without this patch, any characters are allowed in the lookup field, and overriding this behavior requires subclassing router and copying and pasting the implementation of get_lookup_regex.
It's possible it would be better to remove this functionality from the routers and simply expose a parameter to get_lookup_regex which allows overriding the lookup_regex. That way the viewset config logic could be in the a subclass, which could invoke the super method directly.
I'm using this now for PostgreSQL UUID fields using https://github.com/dcramer/django-uuidfield . Without this patch, that field passes the lookup string to the database driver, which raises a DataError to complain about the invalid UUID. It's possible the field ought to signal this error in a different way, which could obviate the need to specify a pattern.
2014-01-04 16:45:03 -05:00
Tom Christie
52686420f4
Merge branch 'bennbollay-patch-1' into 2.4.0
...
Conflicts:
.travis.yml
docs/api-guide/routers.md
rest_framework/compat.py
tox.ini
2013-12-23 09:48:59 +00:00
Tom Christie
83b31e7ea2
Merge branch 'patch-1' of git://github.com/bennbollay/django-rest-framework into bennbollay-patch-1
2013-12-23 09:20:59 +00:00
Tom Christie
d8a95b4b6d
Back out permissions example change in favor of easier to follow example
2013-12-23 09:12:34 +00:00
Tom Christie
c385723648
Merge pull request #1315 from amatellanes/master
...
Simplified some examples in tutorial
2013-12-23 01:10:13 -08:00
amatellanes
2846ddb5d2
Simplified some examples in tutorial
2013-12-23 09:06:03 +01:00
amatellanes
67a2b5a8cb
Merge remote-tracking branch 'upstream/master'
2013-12-23 09:00:28 +01:00
amatellanes
74f1cf6355
Revert "Simplified some examples in tutorial"
...
This reverts commit d6806340e5
.
2013-12-23 08:56:34 +01:00
amatellanes
d6806340e5
Simplified some examples in tutorial
2013-12-23 08:50:46 +01:00
bennbollay
e5caf48a12
Change the page title to prioritize page content
...
When many tab's are open (which is necessary for DRF's documentation), it becomes impossible to determine which tab contains which pieces of documentation. That they are all related is obvious by the use of a common icon, just not the specific page each tab is loaded to.
This change inverts the order of the title to maintain as much useful context as possible on the tabbar.
2013-12-22 16:53:52 -08:00
Tom Christie
9b7341e484
Merge pull request #1312 from amatellanes/master
...
Simplified some functions in permissions.py
2013-12-22 04:53:00 -08:00
amatellanes
2d6d725c2f
Simplified some functions
2013-12-22 12:39:47 +01:00
Tom Christie
b7482629c3
Merge pull request #1309 from lukaszb/errors-for-renamed-fields
...
Should it be that way?
2013-12-21 13:58:49 -08:00
Tom Christie
71ab7cda2a
Additional test for 'source' behaviour. Refs #1302
2013-12-21 21:54:51 +00:00
Tom Christie
a439c80cd8
Less brittle through relationship testing. Closes #1292 .
2013-12-21 21:21:53 +00:00
Tom Christie
bc0e994784
Added example of using APIException class. Closes #1300
2013-12-21 21:10:05 +00:00
Tom Christie
1f3ded4559
Docs tweaks
2013-12-21 17:18:25 +00:00
Tom Christie
e6fac63536
Merge pull request #1310 from vbabiy/adding-djangorestframework-camel-case-to-docs
...
djangorestframework-camel-case in docs
2013-12-21 09:12:50 -08:00
Vitaly Babiy
22343ee117
Added links to djangorestframework-camel-case in the third party
...
sections of the docs for both parsers and renderers.
2013-12-21 07:07:06 -05:00
Lukasz Balcerzak
973f898a4b
Should it be that way?
2013-12-20 17:45:56 +01:00
Tom Christie
46906b2bdc
Merge pull request #1308 from lukaszb/missing-custom-validation-method-test
...
Added missing custom validation method test
2013-12-20 08:37:30 -08:00
Lukasz Balcerzak
71aa5f3c45
Added missing custom validation method test
2013-12-20 17:16:24 +01:00
Tom Christie
c66b0f8835
Merge pull request #1307 from lukaszb/test-class-name-duplicated
...
Updated test class name to be unique
2013-12-20 08:13:09 -08:00
Lukasz Balcerzak
0e3822d6e0
Updated test class name to be unique
2013-12-20 16:53:06 +01:00
Tom Christie
02ae1682b5
Add note on compat import in tutorial
2013-12-17 09:45:28 +00:00
Tom Christie
7bdb1b2eef
Merge pull request #1301 from linovia/bugfix/tutorial_for_python3
...
Fix tutorial's step 1 for Python 3
2013-12-17 01:42:47 -08:00
Xavier Ordoquy
8026480454
Use the BytesIO for buffering bytes and import the one from the compat module.
2013-12-17 10:30:23 +01:00
Tom Christie
8894019899
Merge branch 'nullbooleanfield_testcase' of git://github.com/dpetzel/django-rest-framework into dpetzel-nullbooleanfield_testcase
...
Conflicts:
rest_framework/tests/test_serializer.py
2013-12-16 13:51:57 +00:00
Tom Christie
0f37260254
Merge pull request #1184 from dpetzel/nullbooleanfield_fix
...
Fix infered field type for models.NullBooleanField
2013-12-16 05:50:10 -08:00
Tom Christie
4f58263cd1
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
2013-12-16 11:59:49 +00:00
Tom Christie
f0f7a91b31
Add CONTRIBUTING.md
2013-12-16 11:59:37 +00:00
Tom Christie
31dd160256
Typo
2013-12-16 11:59:14 +00:00
Tom Christie
4bc829d4e9
Merge pull request #1298 from craigds/fix-nested-serializers-with-renamed-fields
...
Fix nested serializers with renamed fields
2013-12-16 01:18:31 -08:00
Tom Christie
fc2dee844a
Don't import compat.py from authtoken.models. Closes #1297
2013-12-16 08:59:10 +00:00
Craig de Stigter
4a134eefa2
Fix expansion of writable nested serializers where the inner fields have source set.
2013-12-16 15:55:54 +13:00
Tom Christie
69fef838cc
Update django-oauth-plus version
2013-12-14 21:05:11 +00:00
Tom Christie
6b6b255684
Add note on pagination bugfix. Closes #1293 .
2013-12-14 20:42:58 +00:00
Tom Christie
f78b3187df
Added @philipforget for work on #1232 . Thanks :)
2013-12-13 22:01:19 +00:00
Tom Christie
54d3c6a725
Updated release notes
2013-12-13 21:59:47 +00:00
Tom Christie
a87c55a93a
Compat fixes for django-oauth-plus versions 2.0-2.2.1
2013-12-13 21:57:07 +00:00
Tom Christie
fac6d1a36e
Merge branch 'master' of git://github.com/philipforget/django-rest-framework into philipforget-master
2013-12-13 20:40:11 +00:00
Tom Christie
39dbea4da4
Links to drf-nested-routers
2013-12-13 20:27:17 +00:00
Tom Christie
193af483ef
Add notes on lookup_prefix argument and why it's there even though unused by the default implementations.
2013-12-13 20:22:56 +00:00
Tom Christie
fbaba0a309
Merge pull request #1281 from alanjds/router-prefix-patch
...
'lookup_prefix' on SimpleRouter.get_lookup_regex, easing code de-duplication
2013-12-13 12:19:49 -08:00
Tom Christie
87b99d1ac8
Update release notes
2013-12-13 20:17:26 +00:00
Tom Christie
8b2f0cc3d7
Merge pull request #1291 from kevin-brown/issue_1101
...
Fix default values always being False for browsable API
2013-12-13 12:15:23 -08:00
Kevin Brown
90edcbf938
Fix default values always being False for browsable API
...
This fixes a bug that was introduced in 28ff6fb
[1] for the
browsable API, specifically with how it handled default values
for boolean fields. Previously, it had a global default for
boolean fields set to `False`, which was different than the
standard None that was used elsewhere. Because this only needed
to be done for the browsable API, a fix was put into place that
only set the default to `False` when form data was passed into
the serializer. This had the unintended side effect of overriding
any default set on the boolean field.
This fixes #1101 [2] by only overriding the default if the default is
`None`, which is the default for all fields.
[1]: 28ff6fb1ec
[2]: https://github.com/tomchristie/django-rest-framework/issues/1101
2013-12-13 13:20:29 -05:00
Tom Christie
9c41c007af
Merge branch 'master' into 2.4.0
...
Conflicts:
.travis.yml
docs/api-guide/routers.md
docs/topics/release-notes.md
rest_framework/compat.py
2013-12-13 16:32:34 +00:00
Tom Christie
ca244ad614
Expanded notes in quickstart. Closes #1127 . Closes #1128 .
2013-12-13 15:30:59 +00:00