Commit Graph

2289 Commits

Author SHA1 Message Date
George Hickman
e5d66d3ef8 Add public facing methods to BaseCacheLookup
There seems little point in using BaseCacheLookup by default so it can
act as an example to implementing classes.
2013-04-02 14:29:21 +01:00
George Hickman
2139c109ab Dont' require IF_MATCH header
The HTTP RFC doesn't require the IF_MATCH header and it's language on
what to do when it's not included isn't absolute so removing this check.

The implementing codebase can easily add this by overriding
precondition_check in ETagCacheLookup if necessary.
2013-04-02 12:31:03 +01:00
George Hickman
879302c815 Add update header to ETagCacheLookup
Need to use the IF_MATCH header to check the validity of updating a
model in PUT and DELETE methods.
2013-04-02 12:02:26 +01:00
George Hickman
70199d9755 Tidy up header usage
Explicity define request and response headers.
2013-04-02 10:53:04 +01:00
George Hickman
5e5de9c499 Only preemptively check the cache on GET requests 2013-04-02 10:46:48 +01:00
George Hickman
cede7d86a3 Refactor precondition check into the cache lookup backends 2013-04-02 10:45:47 +01:00
George Hickman
65b16071c4 Get cache keys from a model or instance 2013-04-02 10:43:44 +01:00
George Hickman
4f43804d42 Move cache lookup code to a pluggable backend
ETagCacheLookup is the first example implementation.
2013-04-01 16:15:05 +01:00
George Hickman
00778e3d24 Use built-in status code variables 2013-03-21 00:23:31 -07:00
George Hickman
61f6fe2b81 Check use_etags before trying to set ETag header 2013-03-21 00:03:41 -07:00
George Hickman
a337dc3b5f Add IfMatchMissing exception
Needed to make testing easier.
2013-03-20 23:57:00 -07:00
George Hickman
cfd083d759 Tidy up etag precondition checks 2013-03-20 23:17:30 -07:00
George Hickman
bceca2364a Switch to a view level setting for using etags
* Check for existance of `use_etags` as a precondition.
* Set etag_header irregardless of the HTTP_IF_MATCH header state.
2013-03-20 23:14:27 -07:00
George Hickman
53ca0c02b0 Add PreconditionFailed exception 2013-03-20 23:10:24 -07:00
George Hickman
ebb47bb38f Basic implementation of etags
Settings and options aren't sorted at all, but the functionality exists
in the rest verb methods.
2013-03-12 20:35:36 -07:00
Tom Christie
2088023293 Update release notes 2013-03-10 20:39:04 +00:00
Tom Christie
0df008dc83 Added @bouke for bug fix #722. Thanks! 2013-03-10 20:37:15 +00:00
Tom Christie
99b18d7485 Merge pull request #722 from Bouke/patch-1
PrimaryKeyRelatedField with OneToOneField serializes wrong object's id
2013-03-10 13:34:02 -07: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
Tom Christie
239758e034 Serializers support bulk create. 2013-03-09 10:21:53 +00:00
Tom Christie
2c6c5d966e Update release notes. 2013-03-08 23:49:27 +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
6c1fcc855a Update release notes 2013-03-08 22:46:37 +00:00
Tom Christie
775b4314ed Merge pull request #716 from tomchristie/list-deserialization
List deserialization
2013-03-08 14:45:25 -08:00
Tom Christie
28ae26466e Py3k fixes. 2013-03-08 22:43:46 +00:00
Tom Christie
0b6267d8cd Added @bitmonkey. Thanks!
For work on handling errors when deserializing lists of objects.
2013-03-08 22:28:59 +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
4d48de631b Docs on per-object filtering 2013-03-08 20:41:00 +00:00
Tom Christie
5fffaf89e2 Merge pull request #711 from toranb/master
GenericAPIView now applies filter_backend for list and retrieve api views
2013-03-08 08:15:56 -08: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
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
f5a8f172a3 Merge pull request #708 from kevinastone/master
Fixed DateField with Empty Values (Fixes #707)
2013-03-07 01:01:07 -08: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
Tom Christie
751064a6fd Merge pull request #706 from markotibold/clean-install
Prevent warning: no files found matching '*.txt' under directory
2013-03-06 14:33:31 -08:00
Marko Tibold
1037888505 Prevent warning: no files found matching '*.txt' under directory
'rest_framework/templates' (there are only .html files in the templates
directory).
2013-03-06 21:16:40 +01:00
Tom Christie
ddd7125a63 Tweak travis badge positioning. 2013-03-06 13:35:04 +00:00
Tom Christie
cdf7c778d8 Version 2.2.2 2013-03-06 12:29:56 +00:00
Tom Christie
5422eedd0a Add tox note. 2013-03-06 12:29:32 +00:00
Tom Christie
6135df56c6 Merge pull request #703 from tomchristie/datetime-formats
Datetime formats
2013-03-06 04:25:35 -08:00
Tom Christie
d260f1ec15 Add tox note. 2013-03-06 12:19:49 +00:00
Tom Christie
1106596c80 Clean ups to datetime formatting 2013-03-06 12:19:39 +00:00
Tom Christie
4f7b028a0a Updating docs 2013-03-05 20:57:35 +00:00
Tom Christie
c20ebe95f6 Merge datetime formats 2013-03-05 17:50:28 +00:00
Stephan Groß
17e0ff0fcd Add @iekadou for #700 support. thanks! 2013-03-05 18:45:09 +01:00