Ryan P Kilby
0148a9f8da
Improvements to ViewSet extra actions ( #5605 )
...
* View suffix already set by initializer
* Add 'name' and 'description' attributes to ViewSet
ViewSets may now provide their `name` and `description` attributes
directly, instead of relying on view introspection to derive them.
These attributes may also be provided with the view's initkwargs.
The ViewSet `name` and `suffix` initkwargs are mutually exclusive.
The `action` decorator now provides the `name` and `description` to
the view's initkwargs. By default, these values are derived from the
method name and its docstring. The `name` may be overridden by providing
it as an argument to the decorator.
The `get_view_name` and `get_view_description` hooks now provide the
view instance to the handler, instead of the view class. The default
implementations of these handlers now respect the `name`/`description`.
* Add 'extra actions' to ViewSet & browsable APIs
* Update simple router tests
Removed old test logic around link/action decorators from `v2.3`. Also
simplified the test by making the results explicit instead of computed.
* Add method mapping to ViewSet actions
* Document extra action method mapping
2018-07-06 10:33:10 +02:00
Daniel Hahler
56967dbd90
Fix upload parser test ( #6044 )
2018-07-05 23:52:32 -04:00
Ryan P Kilby
0e10d32fb1
Add NotImplementedError to coverage exclusion ( #6057 )
2018-06-24 17:56:31 -04:00
Ryan P Kilby
c5ab65923f
tests/test_permissions.py: do not add view perm for dj21 ( #6055 )
2018-06-23 07:31:06 -04:00
Daniel Hahler
499533d219
Use [tool:pytest] header in setup.cfg ( #6045 )
2018-06-22 18:14:26 -04:00
Chris Shyi
d9f541836b
Update to Django 2.0 Routing Syntax ( #6049 )
2018-06-22 10:28:59 +02:00
Ryan P Kilby
1a170438d2
Add "optionals not required" build ( #6047 )
2018-06-22 10:16:57 +02:00
Daniel Hahler
7e0ad9262e
tests: update pytest/pytest-django ( #6042 )
2018-06-21 16:23:52 -04:00
Daniel Hahler
a44cb67988
tests: fix usage of transaction.non_atomic_requests ( #6043 )
2018-06-21 14:44:58 -04:00
Daniel Hahler
06526cafe5
runtests.py: clean up PYTEST_ARGS ( #6040 )
...
1. `tests` and `--tb=short` is not necessary, since it is in
`pytest.addopts` already.
2. removes `-s` (shortcut for --capture=no): it is typically a good idea
to not display output from successful tests.
2018-06-21 14:28:25 +01:00
Çağıl
8f55cd8db5
Fix url for group_names action example ( #6036 )
2018-06-21 04:29:05 -04:00
Asif Saifuddin Auvi
d778c5e51e
Update tox to use Django v2.1b1 ( #6037 )
2018-06-21 09:07:33 +02:00
William S. Vincent
feffa109a8
Add REST APIs with Django book ( #6033 )
...
Just published book dedicated to DRF.
2018-06-20 00:24:26 +01:00
Xavier Ordoquy
3fcc076d91
Merge pull request #6024 from tveastman/master
...
Documentation: Correct the signature for HyperlinkedRelatedField.get_object()
2018-06-13 07:43:35 +02:00
Tom Eastman
be2bcf7e3f
Documentation: Correct the signature for HyperlinkedRelatedField.get_object()
2018-06-13 16:39:28 +12:00
Emeka Icha
a21484d90e
(fix) link to disqus article on cursor pagination ( #6020 )
2018-06-12 10:34:28 +01:00
Xavier Ordoquy
8688c99602
Merge pull request #6019 from jdufresne/pypi-register
...
Update incorrect PyPI URL to register an account
2018-06-10 09:49:16 +02:00
Jon Dufresne
89fb0b0f99
Update incorrect PyPI URL to register an account
...
To register an account on PyPI, the URL is
https://pypi.org/account/register/ , which changed after the move to
pypi.org.
2018-06-09 19:09:31 -07:00
Tom Christie
26b0f650d6
Update LICENSE.md
2018-06-04 09:16:18 +01:00
Tom Christie
206423009b
Update LICENSE.md
2018-06-04 09:15:05 +01:00
Steven Loria
cf925caa48
Render markdown readme on PyPI ( #6004 )
...
* Render markdown readme on PyPI
PyPI now supports GitHub-flavored Markdown descriptions
(https://blog.thea.codes/github-flavored-markdown-on-pypi/ ),
so there's no need to convert the README to rst with pypandoc
any more.
* Remove readme checking
Checking markdown descriptions is not necessary.
See https://github.com/pypa/readme_renderer#markdown
* Upgrade twine
2018-06-03 19:21:04 +01:00
Matt Layman
f67d23c441
Add docs link to Caching API Guide. ( #6012 )
2018-05-31 09:58:02 +02:00
Teppei Fukuda
fe54575e6a
Fix exceptions.md ( #6003 )
2018-05-25 10:42:22 +01:00
Xavier Ordoquy
a7cd1dbc43
Merge pull request #6001 from auvipy/master
...
updated tox and travis for django 2.1 alpha1
2018-05-23 21:10:27 +02:00
Asif Saifuddin Auvi
2634294667
updated tox and travis for django 2.1 alpha1
2018-05-23 16:33:15 +06:00
int3l
1ee3829a2f
Update the http signature auth library ref link ( #5997 )
...
* Update the http signature auth library ref link
It seems that the djangorestframework-httpsignature package is outdated
and there is updated fork named drf-httpsig.
* Fixing the link ref format in the http signature section
2018-05-22 12:22:09 +01:00
Tamirlan Omarov
edfcbe076d
Added pagination section to the quickstart page ( #5987 )
2018-05-21 13:32:07 +01:00
John Franey
f20e282d15
Update documenting-your-api.md ( #5991 )
...
Fix link to "Schemas as Documentation: Examples"
2018-05-17 00:36:41 -04:00
Eduardo GP
ff4429fad4
fix e.indexOf is not a function error ( #5982 )
2018-05-11 21:49:29 +01:00
Craig de Stigter
9629886915
Fixed AttributeError from items filter when value is None ( #5981 )
2018-05-11 08:50:08 +02:00
Daniel Hahler
c17b4ad0d0
Include coverage for tests ( #5970 )
...
It is useful to see if tests itself are covered after all - missing
coverage there typically indicates dead/missed code paths.
This also uses `source=.` and includes (with run and report), to help
Codecov with reporting.
Ref: https://github.com/encode/django-rest-framework/pull/5956
2018-05-08 14:02:45 +01:00
Daniel Hahler
275c157341
tests: remove some dead code, use assert 0
for never called methods ( #5973 )
...
* tests: remove some dead code, use `assert 0` for never called methods
* fixup! tests: remove some dead code, use `assert 0` for never called methods
2018-05-08 13:28:46 +01:00
Daniel Hahler
4527a753cd
Move pytest config to setup.cfg ( #5979 )
...
Also adds `testspath` to improve test collection performance.
2018-05-08 13:28:16 +01:00
Daniel Hahler
fca39f9dbb
tests: fix test_write_only_fields not being executed ( #5971 )
...
This adds the required `test_` prefix.
2018-05-08 09:27:35 +01:00
Daniel Hahler
4c29752b6a
requirements-testing: update pytest and pytest-django ( #5972 )
2018-05-08 09:27:25 +01:00
Tom Christie
da4ecfddc2
Update .gitignore
2018-05-08 09:21:32 +01:00
Tom Christie
6957aaae85
Delete config
2018-05-08 09:20:01 +01:00
Tom Christie
0218f20ac4
Delete .editorconfig
2018-05-08 09:19:31 +01:00
Ari Rouvinen
45acfe05b4
Add missing comma ( #5978 )
2018-05-08 09:15:59 +01:00
Daniel Hahler
40d5985f57
requirements-optionals: use psycopg2-binary ( #5969 )
...
Ref: https://github.com/encode/django-rest-framework/pull/5967#issuecomment-386431446
2018-05-08 09:15:32 +01:00
Andreas Lutro
a6b6b6ce55
remove references to DOAC in docs ( #5977 )
...
Project has been archived on github and recommends alternative.
2018-05-08 09:10:43 +01:00
Chris Shyi
fc2143207b
Update tutorial to Django 2.0 routing syntax ( #5963 ) ( #5964 )
...
Update tutorial to Django 2.0 routing syntax
2018-05-08 09:06:14 +01:00
Xavier Ordoquy
4340ff42de
Merge pull request #5976 from victormpa/fix_filter_docs
...
Added import statement on filtering docs
2018-05-07 05:40:59 +00:00
Victor Martins
21c0fcf63b
Added import statement on filtering docs
2018-05-06 00:02:09 -03:00
Daniel Hahler
fd4282c7fa
pytest: use --strict ( #5966 )
...
This causes errors with invalid markers:
> AttributeError: 'skipUnless' not a registered marker
Fixed in https://github.com/encode/django-rest-framework/pull/5965 .
2018-05-03 21:43:57 +01:00
Daniel Hahler
d4dc24ea3e
requirements-optionals.txt: bump psycopg2 to 2.7.4 ( #5967 )
...
With 2.7.3 I am seeing an ImportError on Arch Linux:
> ImportError: …/.venv/lib/python3.6/site-packages/psycopg2/.libs/libresolv-2-c4c53def.5.so:
> symbol __res_maybe_init version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
2018-05-03 13:32:39 +01:00
Daniel Hahler
e79610af3a
tests: fix skipping with TestPosgresFieldsMapping ( #5965 )
...
`pytest.mark.skipUnless` does not exist, it was confused with
`unittest.skipUnless` probably.
2018-05-03 13:31:46 +01:00
Çağıl
8c03c49400
update testing.md - fixes related to RequestsClient ( #5959 )
...
* Include import for RequestsClient in the docs.
* Use fully qualified URLs for `RequestsClient` in the docs.
2018-04-26 12:47:38 +01:00
Ryan O’Hara
a11938ce96
Fixed instance being overwritten in pk-only optimization try/except block ( #5747 )
2018-04-24 16:15:38 +02:00
Noam
7268643b25
min_value/max_value support in DurationField ( #5643 )
...
* Added min_value/max_value field arguments to DurationField.
* Made field mapping use mix/max kwargs for DurationField validators.
2018-04-24 09:24:05 +02:00