Commit Graph

134 Commits

Author SHA1 Message Date
Yamila Moreno
82e9ddcf7a Added get_filter_backends method 2013-10-24 16:16:01 +02:00
Tom Christie
f2648fefff Merge pull request #1187 from ross/paginator_def_val
paginator should validate page and provide default
2013-10-22 02:19:36 -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
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
Henry Clifford
3e94f4dc70 support args on get_object_or_404 2013-10-04 10:49:56 -04:00
Tom Christie
21cd638659 Merge master 2013-09-25 09:44:26 +01:00
Edmond Wong
6e7e4fc01c Added test for OPTIONS before object creation from a PUT 2013-09-03 12:30:18 -07: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
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
Alexander Akhmetov
7fb3f078f0 fix for python3 2013-08-27 17:42:10 +04:00
Alexander Akhmetov
316de3a8a3 Added max_paginate_by parameter 2013-08-26 20:14:17 +04:00
Tom Christie
16ffdedd14 Merge master 2013-08-21 21:31:59 +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
379ad8a824 pending deprecations -> deprecated 2013-06-27 20:36:14 +01:00
inglesp
b1847412b5 Typo 2013-06-12 20:00:33 +02:00
Tom Christie
f8a0d31d71 Remove ConfigurationError in favor of Django's ImproperlyConfigured 2013-06-05 13:45:28 +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
fcaee6e580 Clean up OPTIONS implementation 2013-05-24 23:44:23 +01: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
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
dc7b1d6430 2.2's PendingDeprecationWarnings now become DeprecationWarnings. 2.3's PendingDeprecationWarnings added. 2013-04-29 12:45:00 +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
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
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
371698331c Tweaks 2013-04-04 22:24:30 +01: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
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
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
c18fb0d695 Added a post_save hook. Closes #558. 2013-02-06 21:28:03 +00:00
Tom Christie
55fd646631 Set many explicitly from mixins. Refs #564. 2013-02-06 13:04:11 +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
71e55cc4f6 Merge with latest master 2013-01-15 17:53:24 +00:00
Tom Christie
6da9cd5429 Add .patch() method for RetrieveUpdateAPIView 2013-01-02 17:43:43 +00: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
Andrew Hankinson
b9e48e8413 Removing Partial Update classes
PATCH methods merged into RetrieveUpdateDestroy class
2012-12-30 13:56:59 -04:00
Andrew Hankinson
18338a37d3 Adding PATCH support to Django REST Framework 2012-12-16 14:49:18 -05:00
Stephan Groß
76c840f1bb added missing line 2012-12-13 20:41:40 +01:00
Stephan Groß
e198a2b376 added RetrieveUpdateAPIView 2012-12-13 16:57:17 +01:00
Tom Christie
acbe991209 Tidying 2012-11-16 23:22:15 +00:00
Tom Christie
e40000c834 Merge pull request #408 from markotibold/file_and_image_fields
Added a FileField and an ImageField
2012-11-16 14:48:42 -08:00
Tom Christie
31f01bd631 Polishing to page size query parameters & more docs 2012-11-16 22:45:57 +00:00
Tom Christie
8d3581f4bd Minor tweaks to internals of generics and mixins 2012-11-16 21:27:34 +00:00
Marko Tibold
403886b79b Merge commit '3b258d69c92e9d9293f7c5d1690f0ca434e677e3' into file_and_image_fields 2012-11-15 22:48:22 +01:00
Tom Christie
647abcdb16 Bring keywrod args in line with Django's implementation 2012-11-14 19:34:27 +00:00
Marko Tibold
5443dd5f3c Added a FileField and an ImageField (copied from django.forms.fields).
Adjusted generics, mixins and serializers to take a `files` arg where applicable.
2012-11-13 23:26:17 +01:00
Tom Christie
47b534a13e Make filtering optional, and pluggable. 2012-11-07 21:07:24 +00:00
Tom Christie
9fd061a0b6 Merge branch 'restframework2-filter' of git://github.com/onepercentclub/django-rest-framework into filtering 2012-11-07 20:13:27 +00:00
Tom Christie
cedb3860f4 Use saner get_serializer signature 2012-11-06 17:05:15 +00:00
Ben Konrath
09f39bd23b Merge branch 'master' into restframework2-filter 2012-11-06 03:22:25 +01:00
Tom Christie
b7b942c599 Swap position of instance and data keyword arguments. 2012-11-05 10:53:20 +00:00
Ben Konrath
9c82f9717e Merge branch 'master' into restframework2-filter 2012-11-01 14:06:56 +01:00
Marko Tibold
4d90bb4af4 Fix some typos. 2012-10-30 00:30:52 +01:00
Tom Christie
44207a347a pep8 2012-10-27 10:33:01 +01:00
Jamie Matthews
27935f6f66 Rework generic view class names 2012-10-25 13:50:39 +01:00
Jamie Matthews
d6e10b50fc Re-add implementation of multiple-operation generic views to remove diamond inheritance 2012-10-25 12:26:08 +01:00
Jamie Matthews
32ebf96ef6 Split concrete generic views up into separate bits of functionality 2012-10-24 18:22:29 +01:00
Tom Christie
fed235dd01 Make settings consistent with corrosponding view attributes 2012-10-17 23:09:11 +01:00
Ben Konrath
1e9ece0f93 First attempt at adding filter support.
The filter support uses django-filter to work its magic.
2012-10-11 12:01:07 +02:00
Tom Christie
f79ed6175d Add RetrieveDestroyAPIView and remove Metadata mixin 2012-10-08 14:13:15 +01:00
Tom Christie
cc21948a69 Fix django 1.3 bug 2012-10-05 17:02:33 +01:00
Tom Christie
3e862c7737 Tweak view slightly 2012-10-05 14:22:02 +01:00
Tom Christie
c30e0795be Rename generic views 2012-10-03 09:26:15 +01:00
Tom Christie
b16fb57771 Expand pagination support, add docs 2012-10-01 15:49:19 +01:00
Tom Christie
6fa589fefd Pagination support 2012-09-30 17:31:28 +01:00
Tom Christie
e003cc91b6 Get test-only models properly working 2012-09-28 14:28:50 +01:00
Tom Christie
ee36e4ab0c Only display forms when user has permissions. #159 2012-09-27 21:51:46 +01:00
Tom Christie
4b691c4027 Change package name: djangorestframework -> rest_framework 2012-09-20 13:06:27 +01:00