Commit Graph

471 Commits

Author SHA1 Message Date
Tom Christie
af9e4f69d7 Merging master into develop 2012-02-21 20:12:14 +00:00
Tom Christie
b7c06dd8e3 Update djangorestframework/views.py 2012-02-21 14:53:54 +00:00
Daniel Izquierdo
f17f3886f4 Implement `reverse_lazy()' 2012-02-21 22:51:33 +09:00
Daniel Izquierdo
6f4fab81d2 Add a docstring for `reverse()' 2012-02-21 22:51:32 +09:00
Daniel Izquierdo
b600b5075f Update resources.py to use the new custom `reverse()' 2012-02-21 22:44:02 +09:00
Daniel Izquierdo
13110a386c Implement a custom reverse that builds absolute URLs with a request object 2012-02-21 22:44:02 +09:00
Daniel Izquierdo
a29ca6c2d0 Pass the request object to `reverse' in the reverse tests 2012-02-21 22:44:02 +09:00
Daniel Izquierdo
f5badcf80c Stop using set_script_prefix 2012-02-21 22:42:15 +09:00
Daniel Izquierdo
af4851f7a8 Move the new `reverse' function from urlresolvers to utils 2012-02-21 22:41:51 +09:00
Daniel Izquierdo
12e34814e9 Test the custom reverse() function instead of the one provided by Django 2012-02-21 22:41:51 +09:00
Daniel Izquierdo
d808d55b5c Create a custom reverse() function (not implemented yet) 2012-02-21 22:41:51 +09:00
Tom Christie
5a5f24f263 Gotta love dynamic languages 2012-02-21 13:38:21 +00:00
Tom Christie
54a02c1fb9 Version 0.3.3 2012-02-20 20:33:07 +00:00
Tom Christie
9fb7793861 Fix for URLObject 2.0.0 2012-02-20 20:07:14 +00:00
Sean C. Farley
0954765e91 Chase changes to URLObject's API in v2.0.0
URLObject v2.0.0 removed parse() from its API.
2012-02-20 12:56:27 -05:00
Tom Christie
2fea12c88f Merge pull request #168 from poswald/namespace-templates
Namespace templates
2012-02-20 07:26:34 -08:00
Paul Oswald
50198935af Rename templates to 'base.html', 'api.html', 'api.txt' and 'login.html' 2012-02-20 22:16:51 +09:00
Tom Christie
21fcd3a906 Some cleanup 2012-02-20 09:36:03 +00:00
Tom Christie
fbf76c87af Merge git://github.com/sebpiq/django-rest-framework into develop 2012-02-17 09:19:13 +00:00
Tom Christie
87a9072b56 Merge pull request #145 from flashingpumpkin/master
Added a method get_renderers to the ResponseMixin
2012-02-16 07:11:42 -08:00
Paul Oswald
cbd0752740 Move the templates into a named directory 2012-02-15 10:33:49 +09:00
Paul Oswald
e0f7d2cd9f Add empty {% blocks %} to the template to give people a chance to override 2012-02-15 10:21:02 +09:00
Sébastien Piquemal
c04cb5145c merged with trunk 2012-02-14 10:10:04 +02:00
Sébastien Piquemal
821844bb11 fixed examples, corrected small bugs in the process 2012-02-14 10:05:28 +02:00
Paul Oswald
78daa32566 Move stylesheet references to the new relative namespace 2012-02-14 14:50:11 +09:00
Paul Oswald
9c8ca51c78 Delete robots.txt, favicon.ico views; Move style to a new static namespace 2012-02-14 11:25:59 +09:00
Tom Christie
ba1e3b4699 Fix typo. 2012-02-11 21:15:06 +00:00
Tom Christie
1ec165f38c OPTIONS is also a safe method. 2012-02-11 18:43:58 +00:00
Tom Christie
cb8d94b956 Improve docstring on DjangoModelPermissions, and also ensure the user is authenticated. 2012-02-11 18:29:24 +00:00
Tom Christie
2c11fd68f8 Minor name change 2012-02-11 17:48:35 +00:00
Tom Christie
88561a4ee2 Fix up DjangoModelPermissions. 2012-02-11 13:00:38 +00:00
Tom Christie
0e97074fd7 Merge pull request #160 from mammique/django_perms
Django perms
2012-02-11 04:33:34 -08:00
Camille Harang
963d2ecccb DjangoModelPermisson's desc 2012-02-11 02:02:42 +01:00
Camille Harang
b236241982 check authentication after checking ModelResource 2012-02-11 01:54:28 +01:00
Camille Harang
bc80eb266f DjangoModelPermisson 2012-02-11 01:49:28 +01:00
Sébastien Piquemal
b33579a7a1 attempt at fixing the examples 2012-02-10 11:05:20 +02:00
Sébastien Piquemal
db0b01037a made suggested fixes 2012-02-10 10:18:39 +02:00
Alen Mujezinovic
add5f32e8a Merge remote branch 'tomchristie/master' 2012-02-09 11:13:42 +00:00
Sébastien Piquemal
2cdff1b01e modified examples, somethin' still broken, can't find what 2012-02-07 16:52:15 +02:00
Sébastien Piquemal
6963fd3623 some docs for Request/Response/mixins 2012-02-07 16:22:14 +02:00
Sébastien Piquemal
21292d31e7 cleaned Request/Response/mixins to have similar interface 2012-02-07 15:38:54 +02:00
Sébastien Piquemal
ca96b4523b cleaned a bit Response/ResponseMixin code, added some documentation + renamed ErrorResponse to ImmediateResponse 2012-02-07 13:15:30 +02:00
Jamie Matthews
76a7d35813 Ensure duplicate "page" parameters are not created
Previously, URLObject.add_query_param was used to generate
next/previous page links in PaginatorMixin. This resulted
in (for example) page 2's "next" link having the params:

   ?page=2&page=3

Instead, URLObject.set_query_param should be used to replace
the current value of the "page" parameter.
2012-02-07 11:08:55 +00:00
Tom Christie
15fc26f50b Fix up packaging and staticfiles changes. Fixes #155. Fixes #153. Fixes #150. 2012-02-07 08:58:15 +00:00
Sébastien Piquemal
5bb6301b7f Response as a subclass of HttpResponse - first draft, not quite there yet. 2012-02-02 18:19:44 +02:00
Tom Christie
bd25e99f15 Python docs say inherit from Exception, not BaseException. 2012-02-02 09:05:28 +00:00
Sébastien Piquemal
5f59d90645 merged with trunk's master 2012-02-02 08:39:15 +02:00
Camille Harang
da8187d2c2 * -> ** 2012-02-01 23:56:54 +01:00
Tom Christie
894f632598 Remove use of Q objects. 2012-02-01 20:48:32 +00:00
Tom Christie
7886fa2b16 Update test settings for 1.2 2012-02-01 20:24:45 +00:00
Tom Christie
b2fcfffb3b django-staticfiles for Django 1.2 compatability 2012-01-31 09:05:52 +00:00
Tom Christie
50c359c551 Refs #148 2012-01-30 15:54:38 +00:00
Tom Christie
278b3576f3 Fixes #148. Thanks @dvinegla. 2012-01-30 14:13:57 +00:00
Tom Christie
c7a8056034 Use named args in mixin tests. 2012-01-29 13:20:03 +00:00
Tom Christie
c0674e36d4 Drop implicit 'pk' on last arg in urlconf. (Too magical). 2012-01-28 19:06:40 +00:00
Tom Christie
765ec0b76e Use staticfiles for serving css. Fixes #116. 2012-01-28 18:54:02 +00:00
Tom Christie
22ee89f0f3 Tidy up auto-escaping. 2012-01-28 14:38:11 +00:00
Marko Tibold
bbfa404e46 Fix silly error. This makes more sense. 2012-01-28 15:27:06 +01:00
Marko Tibold
cc226e7e67 moving forward 2012-01-28 14:06:34 +01:00
Marko Tibold
a9e0159481 prepare for tagging 2012-01-28 13:38:29 +01:00
Alen Mujezinovic
dd680d7a0a Added get_renderers method to ResponseMixin 2012-01-27 12:56:05 +00:00
Tom Christie
c1fe5da85f Refactoring get_name/get_description 2012-01-25 20:39:01 +00:00
Tom Christie
f5e54c7c32 Merge remote-tracking branch 'btimby/description' 2012-01-25 19:53:04 +00:00
Sébastien Piquemal
152c385f4d enhanced request how-to + example 2012-01-25 00:11:54 +02:00
Tom Christie
df07616c6c Merge pull request #144 from btimby/master
Fix test_with_content_type_args to pass regardless of JSON library idiosyncracies
2012-01-24 12:25:32 -08:00
Ben Timby
d3ec860dd1 Modified test case to pass regardless of JSON library 2012-01-24 14:36:34 -05:00
Ben Timby
54caf6d7ba Modified test case to pass regardless of JSON library 2012-01-24 14:34:29 -05:00
Tom Christie
1d9f24f60d Fix UserLoggedInAuthentication for POST requests.
Fixes #78.
2012-01-24 19:26:37 +00:00
Sébastien Piquemal
714a90d755 documentation for request module 2012-01-24 21:21:10 +02:00
Ben Timby
049d417ebc Reverted formatting 2012-01-24 14:11:10 -05:00
Tom Christie
863bbe7684 Parse url when adding query param. 2012-01-24 18:13:01 +00:00
Tom Christie
27590fea8b Drop redundant comment. 2012-01-24 17:53:54 +00:00
Sébastien Piquemal
8b72b7bf92 corrected request example 2012-01-24 19:16:41 +02:00
Ben Timby
7fa3a214fb Refactored get_name()/get_description() 2012-01-23 13:32:37 -05:00
Ben Timby
2d8739115c Fix for testcase test_with_content_type_args 2012-01-23 13:18:38 -05:00
Tom Christie
8bb427537c Docstring tidy up 2012-01-23 09:06:30 +00:00
Tom Christie
e362344fbd Fix tests to work on all supported configurations. 2012-01-22 20:19:34 +00:00
Sébastien Piquemal
ab0b72a7c1 .DATA, .FILES, overloaded HTTP method, content type and content available directly on the request - see #128 2012-01-22 21:28:34 +02:00
Tom Christie
d1ce9d3914 More consistent comment style. 2012-01-21 18:36:25 +00:00
Tom Christie
dea4a45ec7 pep8/pyflakes cleanup 2012-01-21 18:33:34 +00:00
Tom Christie
a851294d05 get_ordering/get_queryset refactoring 2012-01-21 18:24:10 +00:00
Tom Christie
add6c88a26 Merge https://github.com/mjumbewu/django-rest-framework 2012-01-21 17:58:06 +00:00
Tom Christie
c94423151b Drop short status codes. 2012-01-21 17:55:25 +00:00
Tom Christie
a99a449c88 Add test for PUT with session auth+csrf 2012-01-21 17:47:33 +00:00
Mjumbe Wawatu Poe
417eacb2ed Add a get_object method to the ModelMixin, and tests 2012-01-20 13:05:44 -05:00
Mjumbe Wawatu Poe
26c1558e0f Update the admin static files to handle the latest version of admin 2012-01-20 10:53:30 -05:00
Tom Christie
a8ed7f9189 Merge pull request #130 from flashingpumpkin/master
Added an additional attribute `unknown_form_fields` to `FormResource`
2012-01-19 10:55:31 -08:00
Alen Mujezinovic
4e52ce4d33 Turns out it was self.fields 2012-01-19 18:45:19 +00:00
Chris Pickett
338e77837c Added get_queryset method to ListModelMixin.
This can be easily re-implemented in a view, to allow the user to take
such things as request.user into account when creating the queryset.
2012-01-19 12:56:09 -05:00
Alen Mujezinovic
ec5badf739 Renamed unknown_form_fields to allow_unknown_form_fields 2012-01-19 15:52:26 +00:00
Ben Timby
0a5ca000ed Docstring/whitespace fixes. 2012-01-18 22:59:30 -05:00
Alen Mujezinovic
167dce008c Documentation error. 2012-01-17 11:08:44 +00:00
Alen Mujezinovic
0a167a54fd Added an additional attribute unknown_form_fields to FormResource
If the attribute is set to `True`, the validation method will not
raise an `ErrorResponse` with status 400 but silently strip out
unexpected fields on the form and only return the validated data.
2012-01-17 11:01:32 +00:00
Marko Tibold
5f4096ca28 py25, py26 along with Django12 can't handle assertDictEqual (it was introduced
in py27)
2012-01-13 23:01:16 +01:00
Marko Tibold
905dd2ed9d Got rid of more duplicate tests and put back the tests for #122. 2012-01-13 21:57:49 +01:00
Michele Lazzeri
21776c0de2 split renderer and parser complex data test case 2012-01-13 10:11:34 +01:00
Michele Lazzeri
1bec6f2d5e add testcate XMLRendererTestCase.test_render_and_parse_complex_data 2012-01-12 18:04:18 +01:00
Michele Lazzeri
2966c34352 correct complex data xml parsing 2012-01-12 13:28:32 +01:00
Michele Lazzeri
6b3792aef2 recursive xml parsing 2012-01-11 19:37:43 +01:00
Michele Lazzeri
1664bc7b91 recursive xml parsing 2012-01-11 19:36:43 +01:00
Michele Lazzeri
27d22cff6c Revert "update author"
This reverts commit f461acbaf2.
2012-01-11 19:34:08 +01:00
Michele Lazzeri
ab83a2faae recursive xml parsing 2012-01-11 19:31:08 +01:00
Michele Lazzeri
ad7d921e86 Revert "update author"
This reverts commit f461acbaf2.
2012-01-11 19:29:48 +01:00
Michele Lazzeri
f461acbaf2 update author 2012-01-11 18:58:43 +01:00
Tom Christie
c71b6fb090 Replace 'x.has_key(y)' with 'y in x' 2012-01-11 16:43:04 +00:00
Tom Christie
ed8b296e75 Added test_ugettext_lazy test. Refs #87. 2012-01-11 16:16:22 +00:00
Tom Christie
c995ab397c Made suggested cleanups. Refs #121. 2012-01-11 14:56:12 +00:00
Tom Christie
e8ddbf435c Merge pull request #121 from sebpiq/issue-73
Fixes #73.
Thanks @sebpiq, @ekohl!
2012-01-11 06:53:32 -08:00
Tom Christie
42563d9fbc Remove explicit handling of 'OPTIONS' method, just raise the response, rather than returning it. 2012-01-11 14:48:22 +00:00
Tom Christie
4c438f9f4d Some minor tidy up 2012-01-11 14:42:16 +00:00
Tom Christie
b522cc8e51 Merge https://github.com/dzen/django-rest-framework 2012-01-11 14:37:25 +00:00
Tom Christie
0cfe2acdef Minor cleanup on ModelMixin 2012-01-11 14:07:33 +00:00
Tom Christie
dacc9c0ff7 Merge https://github.com/sebzur/django-rest-framework 2012-01-11 13:54:44 +00:00
Tom Christie
97c5262e9c Refactor add_query_param to use URLObject. Refs #112. 2012-01-11 13:50:43 +00:00
Tom Christie
c8134a6340 Replace tab with spaces. 2012-01-11 13:44:11 +00:00
Tom Christie
b1105edfed Use safe_dump. Fixes #123. 2012-01-11 13:43:47 +00:00
Marko Tibold
aaa14a3e17 fixes #122
tahanks @remcogerlich
2012-01-11 10:27:14 +01:00
Sebastian Żurek
86b1495cad QueryMixin to ModelMixin rename. 2012-01-10 21:42:50 +01:00
Sébastien Piquemal
792bc4d608 fixed issue#73 and added a test 2012-01-10 20:38:01 +02:00
Benoit C
96e91f5841 Add test for final() method 2012-01-10 00:23:19 +01:00
Benoit C
4ab67e789e Introduce a final methods in View class 2012-01-10 00:04:10 +01:00
Ewoud Kohl van Wijngaarden
0d64b4a704 Make a nested if flat
This is a possible fix for issue #73.  The problem occurs when the first
if-statement is true, but the second is not. This results into the
variable obj not being set. This commit solves it by removing that
branch.
2012-01-09 15:56:41 +01:00
Sebastian Żurek
10adf4c31a QueryMixin class updates (comments + docs and the definition of get_instance_data method) 2012-01-08 23:10:21 +01:00
Jamie Matthews
18535c7a38 Preserve existing query params in PaginatorMixin
Previously, generation of next/previous links would discard any existing
query parameters. This commit introduces a dependency on URLObject, which
is used to intelligently parse and modify URLs to ensure existing params
are preserved.

Addresses issues #107
2012-01-05 14:07:31 +00:00
Craig Blaszczyk
46e4ba258f #75 remove except statements which are overly broad in the exception they catch 2012-01-04 18:05:12 +00:00
Marko Tibold
30d881e215 Don't raise when in compat mode, just pass. 2012-01-04 13:55:37 +01:00
Marko Tibold
1f6e3429e4 Fix indentation 2012-01-04 12:23:12 +01:00
Marko Tibold
47e4f0d37d We can now use @unittests.skip 2012-01-04 11:58:22 +01:00
Tom Christie
591bb630d7 0.3.2-dev 2012-01-04 09:52:06 +00:00
Tom Christie
98c563032d Version 0.3.1 2012-01-04 09:44:38 +00:00
Mjumbe Poe
7b6c56a73b Only set the script_prefix if the prefix isn't already a full URL. 2012-01-04 04:18:51 -05:00
Sebastian Żurek
abc7439f8d QueryMixin created + related mixins updates 2012-01-03 09:55:12 +01:00
Tom Christie
2394fc70d1 And add RequestContext too 2011-12-30 16:38:03 +00:00
Tom Christie
c81c0d843e Fixes #102 2011-12-30 16:30:55 +00:00
Tom Christie
904f197474 Replace field-errors with field_errors 2011-12-30 15:33:13 +00:00
Michael Ding
c7b9100f19 change the key name "field-errors" to "field_errors".
as "-" is not allowed as a part of key name in javascript
2011-12-30 22:52:01 +08:00
Tom Christie
a0c4dca946 Version: 0.3.1-dev 2011-12-29 14:00:31 +00:00
Tom Christie
3cf6fab3d9 Version 0.3.0 2011-12-29 13:57:41 +00:00
Tom Christie
07349597ab whitespace fixes 2011-12-29 13:31:12 +00:00
Tom Christie
1bdc5eacc6 Add JSONP. Fixes #82 2011-12-29 13:24:52 +00:00
Tom Christie
6e6dc21376 Fix version test. 2011-12-21 00:52:41 +00:00
Marko Tibold
8162303bc7 Merge branch 'alazaro-master' 2011-12-21 01:10:10 +01:00
Marko Tibold
90ddec03b7 Fixes #94
Modified alazaro's commit sot that both markdown < 2.1 and >= 2.1 are
supported

The test checks if either matches the old or the new style.
2011-12-21 01:06:24 +01:00
Anthony Nemitz
9f63e8dd1d ADMIN_MEDIA_PREFIX is deprecated in django1.4 2011-12-19 22:09:09 -08:00
alazaro
4a60575132 Fixed test broken by markdown update
Removed unused code. No longer needed with  markdown 2.1.0.
2011-12-14 23:36:13 +01:00
Tom Christie
8cabab2703 CSRF for non-dict like .DATA. Fixes #85 2011-12-14 20:19:17 +00:00
Tom Christie
d53f7f45b4 Use 1.4's CSRFMiddleware, so that PUT and DELETE get CSRF validation if session authentication is being used 2011-12-14 20:10:06 +00:00
Tom Christie
050f07e7b1 Ensure that external projects do not need to add 'djangorestframework.tests' to INSTALLED_APPS during testing. 2011-12-14 19:23:48 +00:00
Marco Westerhof
2be350293b fix for unhandled _SkipField exception in Serializer.serialize_model 2011-12-13 11:14:23 +01:00
Tom Christie
cb8931a014 Typo. 2011-12-12 15:33:45 +00:00