Commit Graph

7473 Commits

Author SHA1 Message Date
Carlton Gibson
e7f3219fee Adjust imports 2017-09-14 10:12:12 +02:00
Carlton Gibson
18575c9f5f Split generators, inspectors, views. 2017-09-14 10:12:12 +02:00
Carlton Gibson
9fa8a05b34 Make schemas a package. 2017-09-14 10:12:12 +02:00
Carlton Gibson
344e274a54 Add docstring for ViewInstpector.__get__ descriptor method.
Ref https://github.com/encode/django-rest-framework/pull/5354#discussion_r137265022
2017-09-14 10:12:12 +02:00
Carlton Gibson
18defaf3b1 Docs: Provide full params in example
Ref feedback b52e372f8f (r137254795)
2017-09-14 10:12:12 +02:00
Carlton Gibson
96c39e5c82 Adjust comments 2017-09-14 10:12:12 +02:00
Carlton Gibson
ef9e5f20c8 Add schema decorator for FBVs 2017-09-14 10:12:12 +02:00
Carlton Gibson
398824f96b Add manual_fields kwarg to AutoSchema 2017-09-14 10:12:12 +02:00
Carlton Gibson
416e57f7b8 Refactor to ViewInspector plus AutoSchema
The interface then is **just** `get_link()`
2017-09-14 10:12:12 +02:00
Carlton Gibson
81bac6fe51 Add ManualSchema class 2017-09-14 10:12:12 +02:00
Carlton Gibson
7aa52aca71 Adjust API Reference docs 2017-09-14 10:12:12 +02:00
Carlton Gibson
dc92b55c84 Make view a property
Encapsulates check for a view instance.
2017-09-14 10:12:12 +02:00
Carlton Gibson
183f13ccf4 Pass just url from SchemaGenerator to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
63f6377dff Move get_encoding to descriptor. 2017-09-14 10:12:12 +02:00
Carlton Gibson
aad9289ae9 Move get_filter_fields to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
1d6562e6ad Move get_pagination_fields to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
0a173efac2 Move get_serializer_fields to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
238c5994a2 Move get_path_fields to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
f180397cb0 Remove need for generator in get_description 2017-09-14 10:12:12 +02:00
Carlton Gibson
61ce8bfe12 Move get_description to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
611af4fc35 Move get_link to descriptor 2017-09-14 10:12:12 +02:00
Carlton Gibson
8f13e9c143 Initial Refactor Step
* Add descriptor class
* call from generator
* proxy back to generator for implementation.
2017-09-14 10:12:12 +02:00
Sergei Azarkin
9aaea2586b Fix authtoken managment command (#5415)
* Fix authtoken managment command username param
2017-09-12 14:03:29 +01:00
Jozef
7037ce88e9 Fix throttling documentation about Remote-Addr (#5414)
Clarify in docs that REMOTE_ADDR is part of the WSGI environ, not an HTTP header.
2017-09-12 12:08:32 +01:00
Carlton Gibson
a560a49d56 Merge pull request #5409 from rpkilby/fieldvalues-output
Add value repr to the assertion output in FieldValues tests
2017-09-11 17:34:02 +02:00
Ryan P Kilby
ae95ed1ec2 Add repr(value) to the assert msg in FieldValues 2017-09-11 05:18:39 -04:00
Sanjuro Jogdeo
0e341c24b4 Update get_object() example in permissions.md (#5401)
* Update get_object() example in permissions.md 

I'm a bit confused about the example that's provided in the 'Object level permissions' section.  Other examples (e.g. Tutorial 3 - Class Based Views) provided a pk to get_object().  It doesn't seem like this example has any way of identifying a specific object.  

Just in case I'm correct, I've prepared this pull request. But if I'm wrong, would it be possible for you to explain the example I modified?  

Many Thanks...

* Adjust patch
2017-09-08 18:51:16 +02:00
ersel-ionova
13222e45bc Make status_code documentation more readable. (#5400)
* Make status_code documentation more readable.

* Update status-codes.md
2017-09-08 16:53:17 +01:00
Carlton Gibson
e2b5cef52c Merge pull request #5398 from dolphinigle/master
Fixed the MultipleFieldLookupMixin example to properly check for object level permission
2017-09-07 07:45:58 +02:00
Irvan
b11f37eaf3 Fixed the MultipleFieldLookupMixin example to properly check for object level permission. 2017-09-07 11:06:44 +08:00
Carlton Gibson
71ad99e0b2 Merge pull request #5388 from founders4schools/fix/named-source
Fix ModelSerializer custom named fields with source on model
2017-09-04 17:24:36 +02:00
jhg14
66b2c6149e Fix code style 2017-09-04 16:17:43 +01:00
jhg14
4345894445 Add simplest possible failing test 2017-09-04 15:44:10 +01:00
jhg14
3c1bf6bfd5 Add failing test for named attribute
Fix test crudely

Remove comment
2017-09-04 15:44:04 +01:00
Igor Tokarev
79be20a7c6 Updated supported values for the NullBooleanField (#5387)
* Updated supported values for the NullBooleanField.
* Added check for unhashable types in NullBooleanField.
2017-09-04 10:11:53 +01:00
Daniele Varrazzo
e42eb42d49 Don't make the content mandatory in the generic content form (#5372)
Sometimes, probably in the upgrade from Django 1.9 to 1.10, a post with
empty content is forbidden by javascript, with the message "Please fill
in this field". Filling the form with '{}' allows an application/json
request to be submitted.

The API call itself works perfectly well with a post with empty content:
the interface shouldn't make assumptions about it.
2017-09-04 10:04:48 +01:00
Carlton Gibson
7cd59147ea Merge pull request #5376 from rpkilby/django-perms-queryset
DjangoModelPermissions should perform auth check before accessing the view's queryset
2017-09-04 08:24:40 +02:00
Ryan P Kilby
23b2d8099b Unify QS handling for model/object permissions 2017-09-01 13:56:39 -04:00
Ryan P Kilby
af460d2b69 Add PR 5376 to release notes 2017-09-01 13:37:06 -04:00
Carlton Gibson
139c8fe3d1 Merge pull request #5380 from blueyed/fix-doc
Fix doc for ErrorDetail
2017-09-01 12:39:55 +02:00
Carlton Gibson
dedd9c3863 Merge pull request #5381 from rpkilby/fix-test-name
Fix test name
2017-09-01 12:39:31 +02:00
Ryan P Kilby
bc49746dd3 Fix test name 2017-08-31 08:26:14 -04:00
Daniel Hahler
fff3db5517 Fix doc for ErrorDetail 2017-08-31 12:19:03 +02:00
Carlton Gibson
27c382c98d Merge pull request #5351 from rpkilby/requestfactory-contenttype
Unexpected result when passing empty body to RequestFactory
2017-08-31 12:13:49 +02:00
Ryan P Kilby
0ec915e623 Force content_type inclusion in APIRequestFactory 2017-08-31 05:45:12 -04:00
Carlton Gibson
bafb3ec22a Merge pull request #5375 from rpkilby/related-source-serialization
Fix default value handling for dotted sources
2017-08-31 08:52:32 +02:00
Ryan P Kilby
07258ca032 Remove None handling from fields.get_attribute() 2017-08-30 17:42:12 -04:00
Denis Untevskiy
c8773671e7 + Rejecting anonymous in DjangoModelPermissions *before* the .get_queryset call 2017-08-30 17:10:39 -04:00
Ryan P Kilby
2ea368e80f Add failing test for #5367 2017-08-30 16:53:08 -04:00
Ryan P Kilby
79c1f2154a Fix authorization few perms tests 2017-08-30 16:52:38 -04:00