Commit Graph

7810 Commits

Author SHA1 Message Date
Carlton Gibson
42eb5a4342
Fix read_only + default unique_together validation. (#5922)
* Add test for read_only + default unique_together validation.
* Fix read_only + default validation
2018-04-06 15:20:54 +02:00
gsvr
32caca4dd3 Import coreapi from rest_framework.compat, not directly. (#5921) 2018-04-05 15:07:49 +02:00
Michael
ffac61c6fe Docs: Add missing argument 'detail' to Route (#5920)
The namedtuple Route requires `detail` to be specified, otherwise it
fails with:
`TypeError: __new__() missing 1 required positional argument: 'detail'`

See https://github.com/encode/django-rest-framework/pull/5705/files#diff-88b0cad65f9e1caad64e0c9bb44615f9R34
2018-04-05 14:24:31 +02:00
Carlton Gibson
bc353452f4
Bump version and release notes for 3.8.1 (#5916) 2018-04-04 21:10:34 +02:00
Ryan P Kilby
cba426b34c Use old url_name behavior in route decorators (#5915)
* Wrap action decorator for old url_name behavior
2018-04-04 20:50:42 +02:00
Xavier Ordoquy
3365ec23ec
Merge pull request #5914 from encode/xordoquy/fix_release_notes
release_notes: fix call to super().data
2018-04-04 13:29:48 +00:00
Xavier Ordoquy
3a29eff5f8 release_notes: fix call to super().data
`super().data()` leads to a `TypeError` saying that 'ReturnDict' object
is not callable.
2018-04-04 15:21:36 +02:00
Carlton Gibson
2621e03aa3 Added 3.8 announcement to docs
Correct release notes MD formatting
2018-04-03 16:06:06 +02:00
Carlton Gibson
fc588f539b
Version 3.8 Release (#5769) 2018-04-03 15:35:26 +02:00
Carlton Gibson
1befab795a
Added generic 500 and 400 JSON error handlers. (#5904)
* Added generic 500 and 400 JSON error handlers.
* Docs for generic error views.
2018-04-03 09:16:36 +02:00
Xavier Ordoquy
489d3415ab required extra argument should be a boolean, not a string. (fixes #5906) 2018-03-28 12:39:18 +02:00
Tom Christie
a95cffc73e
Update README.md
Drop the 'chat on gitter' badge.
2018-03-26 12:23:49 +01:00
Andrew Tallos
36119cad31 Enable OrderingFilter to handle an empty tuple (or list) for the 'ordering' field. (#5899) 2018-03-26 12:22:45 +01:00
Craig de Stigter
a5072778e9 Don't show hidden fields in metadata (#5854)
HiddenField is meant to be hidden, but we discovered it showing up in OPTIONS requests
2018-03-23 22:47:10 +00:00
Charlie McBride
a7e2a7bfcd Add LimitOffsetPagination.get_count to allow method override (#5846)
* Add LimitOffsetPagination.get_count to allow method override

* Format method docstring
2018-03-23 22:25:43 +00:00
Xavier Ordoquy
5e6abfbafe
Merge pull request #5894 from auvipy/patch-4
update pytest to 3.5
2018-03-23 13:05:36 +01:00
Asif Saifuddin Auvi
a1c9118685
update pytest to 3.5 2018-03-23 17:23:48 +06:00
Valentino Gagliardi
812d3478bd Added: Tutorial: Django REST with React (Django 2.0) (#5891) 2018-03-21 13:08:36 +00:00
George-Cristian Bîrzan
85c588b0c1 #5848 Allow traversing nullable related fields (#5849) 2018-03-20 22:02:22 +01:00
Carlton Gibson
6c0c69ed65
Correct allow_null behaviour when required=False (#5888)
* Revert "Non-required fields with 'allow_null=True' should not imply a default value (#5639)"
    This reverts commit 905a5579df.
    Closes #5708

* Add test for allow_null + required=False
    Ref #5708: allow_null should imply default=None, even for non-required fields.

* Re-order allow_null and default in field docs
    default is prior to allow_null. allow_null implies an outgoing default=None.

* Adjust allow_null note.
2018-03-20 21:24:39 +01:00
Carlton Gibson
c2b24f83a3
Alter read_only+default behaviour (#5886)
* Always exclude read_only fields from _writable_fields

* Remove `read_only` from `CreateOnlyDefault` example.
      In this context (without mentioning `save`) now slightly misleading.
2018-03-20 21:09:31 +01:00
Anna Ossowski
12569f83c9
Update funding.md 2018-03-20 02:31:44 +01:00
Xavier Ordoquy
0b6a5e568d
Merge pull request #5882 from bholagabbar/patch-2
Updated Link to Rate Limiting Article
2018-03-19 11:02:42 +01:00
Shreyans Sheth
e3f9c65362
Updated Rate Limiting Cite
The current link was broken, fixed it. A good article on rate limiting indeed.
2018-03-19 14:24:21 +05:30
Carlton Gibson
247cf096d4
Test using model objects for dotted source default (#5880)
… when path components may be null.

Ref #5375, #5727
2018-03-16 14:51:37 +01:00
Carlton Gibson
0da461710a
Corrected docs on router include with namespaces. (#5843)
* Provide both app and instance namespace examples
* Emphasise non-namespaced option
2018-03-13 15:52:04 +01:00
gthieleb
9e08a7cbec Fixed schema for UUIDField in SimpleMetadata. (#5872)
* fix schema for UUIDField

* Add unit test for d4c8f2db
2018-03-13 15:49:15 +01:00
Xavier Ordoquy
e3544f999e
Merge pull request #5870 from cgopalan/patch-1
Add admin to installed apps to avoid test failures
2018-03-09 19:56:29 +01:00
Chandrakant Gopalan
20f1203aac
Add admin to installed apps to avoid test failures.
The tests look for the "admin" app in the list of apps. If not present, running `runtests.py` gives the following error:
```
LookupError: No installed app with label 'admin'.
```
Adding admin to `INSTALLED_APPS` fixes it.
2018-03-09 13:04:15 -05:00
Oliver Newman
d2994e0596 Fix comment typo in ModelSerializer (#5844) 2018-02-21 16:39:53 +01:00
Will Vincent
ea7d414b28 Two new tutorials (#5837)
A Todo List API with React and Blog API tutorial
2018-02-19 07:19:42 +00:00
Carlton Gibson
6ea7d05979
Corrected endpoint in tutorial instructions (#5835)
Closes #5810
2018-02-16 16:57:25 +01:00
Carlton Gibson
e34fd995cd
Made TemplateHTMLRenderer render IntegerField inputs when value is 0. (#5834)
* Fix 0 value IntegerField in TemplateHTMLRenderer

Signed-off-by: Nikhil Sheoran <nikhilsheoran96@gmail.com>

* Remove unnecessary `field.value != “”` check

* Adjust test case

Uses `vertical` templates only.
2018-02-16 16:48:20 +01:00
Carlton Gibson
da535d31dd
Fixed active timezone handling for non ISO8601 datetimes. (#5833)
* Add failing test for to_representation with explicit default timezone

See discussion here:
    https://github.com/encode/django-rest-framework/pull/5435#issuecomment-364054509

* Always run enforce_timezone
2018-02-16 16:47:49 +01:00
Daniel Hahler
2854679f56 Upgrade isort (#5817)
* Fix isort

* runtests: add --diff to ISORT_ARGS

* requirements-codestyle: bump isort to 4.3.3

* isort: move config to setup.cfg
2018-02-14 20:12:14 +00:00
James Morris
2bc7cd19a3 Update jobs.md (#5828)
Add weworkcontract.com
2018-02-14 20:10:40 +00:00
Kent Kawashima
d82b332a09 Changes ternary conditionals to be PEP308 compliant (#5827) 2018-02-14 14:06:09 +00:00
Carlton Gibson
7d0d22ffaa Use single copy of static assets. Update jQuery (#5823)
* Move font-awesome to top level.

* Use top-level jQuery & Bootstrap

* Update to jQuery v3.3.1

Compatible with Bootstrap v3.3.7
c.f. https://github.com/twbs/bootstrap/issues/16834#issuecomment-251996660

* Re-add bootstrap-theme
2018-02-12 14:14:44 +00:00
Allisson Azevedo
d1c92c81ff Add Django Rest Framework Role Filters to Third party packages (#5809) 2018-02-08 09:04:51 +01:00
Daniel Hahler
1438719979 requirements-testing: update pytest to 3.4.0 (#5815) 2018-02-08 09:00:44 +01:00
Ryan P Kilby
1bc826e6fd
Fix authtoken views imports (#5818) 2018-02-07 14:46:17 -05:00
Ryan P Kilby
c456b3c510 Fix request formdata handling (#5800)
* Rename 'wsgi' request test to more accurate 'http'

* Test duplicate request stream parsing

* Fix setting post/files on the underlying request
2018-02-05 16:24:13 +01:00
Paulo Scardine
0d5a3a00b0 Add schema to ObtainAuthToken
Add encoding parameter to ManualSchema

Closes #5676

* Fixed lint errors
* Added docs for ManualSchema encoding parameter
2018-02-05 16:16:42 +01:00
Fraire, Santiago
878fe895dc Docs: Added example reimplementing ObtainAuthToken
Closes #5802
2018-02-05 15:53:49 +01:00
Jeremy Lainé
a8d129b7da Represent serializer DictField as an Object in schema
DictFields were incorrectly being output as String in the schema.
This pull request outputs an Object instead and adds a unit test.

Update s/detail_route/action/ after rebase
2018-02-01 16:23:24 +01:00
Jeremy Lainé
27f32faee4 Fix schema generation for PrimaryKeyRelatedField (#5764)
By default all subclasses of RelatedField are output as string fields in
the schema, which works well for StringRelatedField, SlugRelatedField or
HyperlinkedRelatedField.

Handle the common case of a PrimaryKeyRelatedField pointing to an
AutoField.
2018-02-01 16:14:35 +01:00
Carlton Gibson
3c7b3ac6df
Updated step 1 of contributing guide (#5799)
* Create a fork, then clone it.
* Link to GitHub’s How-To.
2018-02-01 16:02:29 +01:00
Veli-Matti Helke
2fa04caf7c small fix to API documentation: schemas (#5796)
adding missing parameters to get_manual_fields()
2018-01-31 14:25:57 +01:00
Si Feng
df77f7bb9d Make 404 & 403 responses consistent with exceptions.APIException output (#5763) 2018-01-30 22:10:02 +00:00
Ryan P Kilby
ece4171ae4 Replace background-attachment: fixed in docs (#5777)
Fixed backgrounds have performance issues on large displays.
2018-01-30 09:08:06 +01:00