Commit Graph

2808 Commits

Author SHA1 Message Date
Tom Christie
9406e45b2c Pass through strings as-in with DateTimeField (#4196) 2016-06-14 12:23:39 +01:00
Tom Christie
2e7fae7698 limit=0 should revert to default limit (#4194) 2016-06-13 16:32:43 +01:00
Tom Christie
c3b7fba918 Exclude read_only=True fields from unique_together validation & add docs. (#4192)
* Exclude read_only=True fields from unique_together validation
* Test to ensure that unique_together validators can be removed
* Do not add uniquness_extra_kwargs when validators are explicitly declared.
* Add docs on validation in complex cases
2016-06-13 13:31:12 +01:00
Tom Christie
9bffd35432 Handle bytestrings in JSON. Closes #4185. (#4191) 2016-06-13 10:41:50 +01:00
Tom Christie
bb22ab8ee7 More robust form rendering in the browsable API (#4181) 2016-06-08 17:13:20 +01:00
Tom Christie
a5f822d067 Empty cases of .validated_data and .errors as lists not dicts for ListSerializer (#4180) 2016-06-08 15:55:09 +01:00
Asif Saifuddin Auvi
04e5b5b20a removed AUTH_USER_MODEL compat property (#4176)
Removed unnecessary `AUTH_USER_MODEL` compat variable.

(No longer required)
2016-06-07 12:13:35 +01:00
Sergei Sinitsyn
94863ee6d0 Change serializer field help_text rendering in browsable api (#3812) 2016-06-02 15:21:57 +01:00
Tom Christie
75751cc64e Allow relative style hyperlinked URLs 2016-06-02 15:03:17 +01:00
Tom Christie
9c996d7d2a Clean up existing deprecation warnings. (#4166)
* Add Meta.fields = '__all__' to serializer classes where required.
* Add explicit on_delete=models.CASCADE to ForeignKey fields.
* Use '.remote_field' and '.model' in preference to '.rel' and '.to' when inspecting model fields.
* Use new value_from_object in preference to internal _get_val_from_obj
2016-06-02 14:39:10 +01:00
Tom Christie
05b0c2adff Don't list M2M choices in OPTIONS requests. Refs #3751. (#4160) 2016-06-01 17:28:32 +01:00
Simon Charette
014e24b024 Do not list related field choices in OPTIONS requests.
Do not list related field choices in OPTIONS requests.
2016-06-01 16:33:03 +01:00
Asif Saifuddin Auvi
b92901e591 updated jquery version to 1.12.4 (#4157)
Updated jquery version to 1.12.4
2016-06-01 15:33:36 +01:00
Tom Christie
994e1ba927 Django 1.10 support. (#4158)
* Added TEMPLATES setting to tests
* Remove deprecated view-string in URL conf
* Replace 'urls = ...' in test classes with override_settings('ROOT_URLCONF=...')
* Refactor UsingURLPatterns to use override_settings(ROOT_URLCONF=...) style
* Get model managers and names in a version-compatible manner.
* Apply override_settings to a TestCase, not a mixin class
* Use '.callback' property instead of private attributes when inspecting urlpatterns
* Pass 'user' to template explicitly
* Correct sorting of import statements.
* Remove unused TEMPLATE_LOADERS setting, in favor of TEMPLATES.
* Remove code style issue
* BaseFilter test requires a concrete model
* Resolve tox.ini issues
* Resolve isort differences between local and tox environments
2016-06-01 15:31:00 +01:00
Tom Christie
fe2aede18d More robust default behavior on OrderingFilter (#4156) 2016-06-01 11:08:04 +01:00
KhasanovBI
92bf8b9197 Wrap guardian.VERSION in tuple, in django-guardian 1.4.2 version has list type and comparison fails. (#4149) 2016-05-26 20:22:38 +01:00
Kennedy Mwenja
592eea9b9e * Use get_serializer_class in ordering filter* Test improper configuration of ordering* Raise ImproperlyConfigured when missing get_serializer_class
* Use get_serializer_class in ordering filter
* Test improper configuration of ordering
* Raise ImproperlyConfigured when missing get_serializer_class
2016-05-26 09:59:13 +01:00
Xiao Hanyu
19bdfda49a Fix #3844, refine validator for fields with <source=> kwargs
When serializers has fields with something like `source=user.email`, the
uniqueness validator should check `email` field instead of `user`, cause
`user` is a model object.
2016-05-26 10:58:37 +08:00
Ben Brostoff
400078311b Fix typos in ReturnDict and ReturnList docstrings 2016-05-16 20:39:13 -04:00
KhasanovBI
768ae26aa4 Fix None values representation in childs of ListField, DictField. (#4118) 2016-05-16 09:30:23 +01:00
José Padilla
daccc2b8f3 Clean up js style and remove extra getCookie function (#4123) 2016-05-16 09:27:38 +01:00
José Padilla
5392be4ddb Spring cleaning template styles (#4124) 2016-05-16 09:27:10 +01:00
Alexander Gaevsky
1328982de3 Set proper status code in AdminRenderer for the redirection after POST/DELETE requests. (#4106) 2016-05-16 09:22:28 +01:00
Tom Christie
ebb4070467 Resolve TimeField representation for midnight value. (#4107) 2016-05-10 11:56:36 +01:00
José Padilla
0795f7394c Prevent raising exception when limit is 0 (#4098) 2016-05-10 10:58:24 +01:00
Hongxia Zhong
d39af5335c Fix incorrect zh-hans and zh-hant locale directory path 2016-05-06 01:22:33 -07:00
Miro Hrončok
ffdac0d936 TokenAuthentication: Allow custom keyword in the header (#4097)
This allows subclassing TokenAuthentication and setting custom keyword,
thus allowing the Authorization header to be for example:

    Bearer 956e252a-513c-48c5-92dd-bfddc364e812

It doesn't change the behavior of TokenAuthentication itself,
it simply allows to reuse the logic of TokenAuthentication without
the need of copy pasting the class and changing one hardcoded string.

Related: #4080
2016-05-04 10:53:34 +01:00
Germán Larraín
e19b21ecc5 Handle incorrectly padded HTTP basic auth header (#4090) 2016-05-03 09:24:55 +01:00
Daniele Varrazzo
88c80fe2e9 Fixed DecimalField arbitrary precision support (#4075) 2016-04-27 17:04:01 +01:00
José Padilla
4f16c54428 Merge pull request #4049 from clintonb/csrf-cookie-fix
Added support for custom CSRF cookie names
2016-04-26 11:43:23 -03:00
Xavier Ordoquy
1823662e1e Merge pull request #4044 from linovia/merge/3.3.x_to_master
Merge the changes in 3.3.x back to master.
2016-04-21 11:31:15 +02:00
Clinton Blackburn
9d9658f128 Added support for custom CSRF cookie names
Instead of hardcoding the CSRF cookie name, the value is passed to the template as a context variable, rendered as a JavaScript variable, and read by csrf.js.

Fixes #4048
2016-04-11 23:58:55 -04:00
Simon Charette
d87f2bc7b6 OrderingFilter adjustements (#3983)
* Made sure the OrderingFilter relies on Field.verbose_name.

* Marked OrderingFilter's order labels for translation.
2016-04-08 15:37:23 +01:00
Xavier Ordoquy
bff3bebdbe Merge remote-tracking branch 'reference/stable/3.3.x' into merge_test
# Conflicts:
#	docs/topics/release-notes.md
2016-04-08 15:46:17 +02:00
Xavier Ordoquy
29a2e549c1 Merge remote-tracking branch 'reference/master' into bug/fix_correct_string_type 2016-04-07 18:03:12 +02:00
Xavier Ordoquy
2622588b30 Typo correction. 2016-04-07 18:00:17 +02:00
Xavier Ordoquy
019c6db759 Fix the string_types / text_types confusion introduced in #4025 (#4035) 2016-04-07 16:34:27 +01:00
Jonathan Liuti
78e4ea0d6e No auth view failing permission should raise 403
A view with no `authentication_classes` set and that fails a

permission check should raise a 403 with the message from the

failing permission.
2016-04-07 16:24:26 +01:00
Xavier Ordoquy
763aab6b45 Fix the string_types / text_types confusion introduced in #4025 2016-04-05 16:29:16 +02:00
Nitesh Lohchab
09aa8f76c4 python2.x and 3.x compatible 2016-04-03 18:39:32 +05:30
Nitesh Lohchab
c22b92a66c type('') to str 2016-04-03 00:07:45 +05:30
Xavier Ordoquy
67ac0486f5 Merge pull request #4006 from mochawich/patch-1
Reorder initializing the view
2016-03-31 13:53:14 +02:00
Tom Viner
3e5a1397d7 remove trailing slash from cramer cursor link 2016-03-24 20:37:38 +00:00
Xavier Ordoquy
cfb77ae6fa Merge pull request #3273 from olliewalsh/breadcrumbs_view_name
Do not ignore overridden View.get_view_name() in breadcrumbs
2016-03-23 01:10:13 +01:00
Xavier Ordoquy
0e8306341d Merge pull request #3936 from carltongibson/null-uuid-fk-take2
Fix None UUID ForeignKey serialization
2016-03-22 22:46:33 +01:00
Mohamad Nour Chawich
03270431ed Reorder initializing the view
Determining the version and performing content negotiation should be done before ensuring the permission of the request. The reason is that these information can be used in handling the exceptions. For example different versions may return different error scheme. Also, the rendering class can be used to determine how to exception handler response should be rendered.
2016-03-20 21:46:37 +01:00
Maxime R
24694ddcb4 Fixed use of deprecated Query.aggregates
In Django 1.8 [`Query.aggregates` is replaced by `annotations`](https://docs.djangoproject.com/es/1.9/releases/1.8/#aggregate-methods-and-modules).

Using aggregates currently raises a `RemovedInDjango20Warning`. [Django's source](https://github.com/django/django/blob/1.8/django/db/models/sql/query.py#L192)
2016-03-18 16:16:13 +01:00
Stephan Groß
a101251a2a Fix blank lines around docstrings 2016-03-17 11:06:47 +00:00
Xavier Ordoquy
265db86590 Translation update. 2016-03-14 08:31:27 +01:00
Carlton Gibson
2ef74cfa61 Bring check for null fk to BaseSerializer.to_representation 2016-03-13 20:39:19 +01:00