Commit Graph

559 Commits

Author SHA1 Message Date
Tom Christie
5500b265bc Test cases for DictField with allow_null options (#4348) 2016-08-02 14:14:36 +01:00
Tom Christie
bda16a518a Dedent tabs. (#4347) 2016-08-02 13:33:14 +01:00
Tom Christie
e37619f741 Serializer defaults should not be included in partial updates. (#4346)
Serializer default values should not be included in partial updates
2016-08-02 13:05:12 +01:00
Tom Christie
3ef3fee926 Descriptive error from FileUploadParser when filename not included. (#4340)
* Descriptive error from FileUploadParser when filename not included.
* Consistent handling of upload filenames
2016-08-01 18:44:58 +01:00
Tom Christie
46a44e52aa Quantize incoming digitals (#4339) 2016-08-01 17:15:41 +01:00
Tom Christie
aa349fe767 Handle non-string input for IP fields (#4338) 2016-08-01 16:14:26 +01:00
Alexander Gaevsky
46a870c002 Fix schema generation for APIView, since it does not have get_serializer_class method. (#4285) 2016-07-27 15:36:36 +01:00
Tom Christie
351e0a4a99 Fix json indent parameter. Closes #4281 (#4313) 2016-07-27 11:49:01 +01:00
Tom Christie
5d3b56f957 Test case for #4272 (#4310)
* Test case for #4272
2016-07-26 16:28:10 +01:00
Sassan Haradji
f0f61aa077 use verbose_name instead of object_name in field_mapping (#4299)
* use verbose_name instead of object_name in error messages
2016-07-26 15:12:51 +01:00
Andi Albrecht
3ca0b15b17 Restore meta information for each search field. (#4298)
The meta information stored in opts needs to be restored for
each search field. Otherwise it references the wrong model
when an attribute of a related model comes before an attribute
of the original model in search fields. This doesn't apply to
m2m relations since must_call_distinct returns True in that
case.
2016-07-26 11:07:03 +01:00
Tom Christie
8385ae42c0 3.4.0 Release (#4258)
* 3.4.0 Release

* Version 3.4 release

* Full release notes

* Update translation files

* Update release documentation

* Update release notes

* Docs on supporting alternate schema formats

* Add schema_renderers to DefaultRouter
2016-07-13 16:30:41 +01:00
Mads Jensen
6defb8da47 lookup_type is deprecated in favor of lookup_expr (#4259)
* lookup_type is deprecated in favor of lookup_expr
* assertEquals is deprecated in favor of assertEqual
* app_name is a required keyword as of Django 1.10
2016-07-13 14:40:42 +01:00
kiyoqoko
6338ce80ab Add localize keyword argument to DecimalField (#4233)
Add `localize` keyword argument for DecimalField
2016-07-06 16:07:16 +01:00
Tom Christie
6ff9840bde Schemas & client libraries. (#4179)
* Added schema generation support.
* New tutorial section.
* API guide on schema generation.
* Topic guide on API clients.
2016-07-04 16:38:17 +01:00
Laurent De Marez
fdde44d9d1 Fix parsing multipart data using a nested serializer with list (#3820)
It is possible that a key in a MultiValueDict has multiple values, lists
are represented this way. When accessing a key in a MultiValueDict
it only returns the last element of that key. This becomes a problem
when parsing an html dict with a list inside of it.

To fix this problem we have to get and set the value using .getlist()
and .setlist().
2016-06-23 16:03:24 +01:00
Tom Christie
bc3485ab7d Namespace versioning with nested namespaces (#4219)
Support nested namespaces with namespaced versioning.
2016-06-23 16:00:11 +01:00
Tom Christie
ea92d50582 Resolve tests against Django master (#4218) 2016-06-23 15:41:25 +01:00
Tom Christie
f81d516ae4 Robust uniqueness checks. (#4217)
* Robust uniqueness checks
* Add master to test matrix (allow_failures)
2016-06-23 15:09:23 +01:00
Simon Charette
90bb0c58ce Prevented unnecessary distinct() call in SearchFilter. (#3938)
* Prevented unnecessary distinct() call in SearchFilter.

* Refactored SearchFilter lookup prefixes.
2016-06-23 13:49:23 +01:00
Tom Christie
9406e45b2c Pass through strings as-in with DateTimeField (#4196) 2016-06-14 12:23:39 +01:00
Tom Christie
1633a0a2b1 Add test confirming that required=False is valid on a relational field (#4195) 2016-06-13 16:52:45 +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
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
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
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
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
Asif Saifuddin Auvi
dc09eef24a Style fix of tests (#4154)
Clean up code style.
2016-06-01 10:40:54 +01:00
Asif Saifuddin Auvi
eef94856d8 deleted description.py as unneeded 2016-06-01 10:24:29 +06:00
Asif Saifuddin Auvi
4fabdee4a3 fix lint error 2016-06-01 02:04:38 +06:00
Asif Saifuddin Auvi
91bb17770e removed description tests unicode related functions 2016-06-01 00:43:37 +06:00
Asif Saifuddin Auvi
3db45cb94d removed description codes as it seems to be python 2.6 issue 2016-06-01 00:39:01 +06: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
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
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
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
Phivos Stylianides
08dad04b19 Fix warnings when running tests (#4047) 2016-04-11 14:13:11 +01: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
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
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
Jared Lang
e34a34e90b Fix empty pk detection in HyperlinkRelatedField.get_url
This implementation allows detection of empty values that are non-nullable, allowing the field to return None values for such cases
2016-03-07 19:37:48 +01:00