Commit Graph

156 Commits

Author SHA1 Message Date
linchiwei123
373195996e Update fields.md (#6784)
Example ==> Example
2019-07-05 14:24:52 +01:00
Ryan P Kilby
82c2b5c3e7
Update mkdocs (#6769) 2019-06-30 19:04:36 -07:00
Min ho Kim
72de94a05d Fix typos in docs (#6747) 2019-06-18 12:58:01 -07:00
Raffaele Salmaso
514033815d Allow JSONField encoder customization. (#6713) 2019-05-24 12:47:35 +01:00
gaetano-guerriero
a7c577cb31 Dict field allow empty (#6583)
* dict field: support allow_empty option

* document ListField allow_empty option

* document HStoreField allow_empty parameter
2019-05-09 09:18:20 +01:00
Carlton Gibson
0407a0df8a
Dropped Python 2 compatibility. (#6615)
Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
2019-04-30 17:53:44 +02:00
Ryan Siemens
d2d1888217 Document DateTimeField default_timezone argument (#6469) 2019-03-12 21:15:12 -07:00
Carlton Gibson
31bf597081 Updated note on BooleanField required kwarg generation.
Closes #6474.
2019-03-01 12:48:12 +01: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
Mikkel Munch Mortensen
9dbb49ef22 Docs: Match original argument names (#5889)
Change argument names in overridden field methods to match those of the base classes.
2018-04-20 15:35:09 +02: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
Max Goodridge
3e5d3752e7 Fixed a typo (#5783) 2018-01-29 08:41:55 +01:00
Ryan P Kilby
2709de1310 Add HStoreField, postgres fields tests (#5654)
* Test postgres field mapping

* Add HStoreField

* Ensure 'HStoreField' child is a 'CharField'

* Add HStoreField docs
2018-01-15 15:52:30 +01:00
Jon Dufresne
d3f3c3d9c1 Prefer https protocol for links in docs when available 2018-01-15 15:15:21 +01:00
Jon Dufresne
d5c34aa813 Remove unused links from docs (#5735)
Each removed link has no inline use.
2018-01-15 15:03:44 +01:00
Ryan P Kilby
5fc35eb7eb Add missing word in 'Field.allow_null' docs 2017-12-22 12:23:07 -05:00
Carlton Gibson
cf3929d88d
Add example using source=‘*’ to custom field docs. (#5688)
* Add example using `source=‘*’` to custom field docs.
* Add nested serialiser example

Closes #2032 closes #3066
2017-12-20 10:04:12 +01:00
Carlton Gibson
2359d3981b
Add docs note re generated BooleanField being required=False (#5665)
* Note that BooleanField default is required=False

Closes #5664
2017-12-14 11:39:54 +01:00
Ryan P Kilby
5f42cb7027 Add allow_null serialization output note (#5641) 2017-12-01 10:07:33 +01:00
Jon Dufresne
ff556a91fd Remove references to unsupported Django versions in docs and code (#5602)
Per the trove classifiers, DRF only supports Django versions 1.10+. Can
drop documentation, code comments, and workarounds for older Django
versions.
2017-11-20 09:35:54 +01:00
Carlton Gibson
331c31370f
Add rounding parameter to DecimalField (#5562)
* Adding rounding parameter to DecimalField.

* Using standard `assert` instead of `self.fail()`.

* add testcase and PEP8 multilines fix

* flake8 fixes

* Use decimal module constants in tests.

* Add docs note for `rounding` parameter.
2017-11-06 09:55:09 +01:00
Ryan P Kilby
6221124e0d Docs about default value for dotted source, additional tests (#5489)
* Add docs note on dotted source + default value

* Add additional dotted source tests
2017-10-16 11:33:46 +02:00
Carlton Gibson
43c7af0bb5 Adjust ListField & DictField signature docs (#5333)
Closes #5301
2017-08-17 10:06:09 +01:00
Steven Johns
9b5a6bea67 Fix typo on fields.md (#5320)
> keeps you error messages

to

> keeps your error messages

and 

> more cleanly separated from your code

to 

> cleaner and more separated from your code
2017-08-09 15:21:23 -04:00
Tibo Beijen
cf5d401a0e Allow required false and default (#4692)
* Default value will now be used when serializing if key or attribute is missing.
2017-03-07 13:19:19 +00:00
Eduard Iskandarov
de8fcbf696 Refs: #4256 delete unrelevant documentation 2017-02-14 13:27:33 +03:00
李扬
cbad236f6d Add max_length and min_length arguments for ListField (#4877) 2017-02-06 09:36:03 +00:00
Xavier Ordoquy
22578525ef Documentation update (#4717) 2016-11-30 12:58:34 +00:00
Germán Larraín
aed8387e05 docs: Fix description of DecimalField's max_digits (#4714)
As of PR #4377, `max_digits=None` is allowed for `DecimalField`.
2016-11-29 15:35:43 +00:00
Xavier Ordoquy
1e0988686c Update the Python doc links to use https and point to Python 3 (#4713) 2016-11-29 12:27:00 +00:00
Carlos de la Torre
d55e176a1e Fix documentation error: removed unused variable (#4647) 2016-11-02 14:03:53 +00:00
Marlon
672e5a0f96 Fix minor typo 2016-08-05 11:57:43 -07: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
306726d9e8 Improve datetime format docs (#4322) 2016-07-28 12:25:21 +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
Adam Chainz
e3337ab4aa Convert readthedocs link for their .org -> .io migration for hosted projects
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:

> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.

Test Plan: Manually visited all the links I’ve modified.
2016-05-29 23:26:56 +01:00
Erick Wilder
a32baeab0c Use datetime example for the Field.initial attribute
Just like regular Django fields, the example adopted uses a `datetiume.date.today` to
illustrate the functionality.
2016-02-19 09:53:50 +01:00
Erick Wilder
908efd6656 #3937 Update docs for the Field.initial attribute.
Add an usage example on how to pass a callable to the `Field.initial` in the docs.
2016-02-17 11:01:09 +01:00
James Beith
34901a5ffa Fix syntax errors in docs example
- Add missing comma in kwargs
- Remove spaces around keyword / parameter equals
- Replace incorrect curly brace with parenthesis
2016-01-24 13:33:18 +00:00
Vedran Karačić
ede15645e0 Typo 2015-11-05 11:51:29 +01:00
Travis J Morton
03cb959416 typo 2015-11-02 12:58:21 -08:00
Tom Christie
6305ae8916 Merge pull request #3475 from tomchristie/forms-api
Forms API
2015-10-22 09:59:57 +01:00
Pierre Dulac
dc72fb4746 Missing the source= keyword for the URLField parameter 2015-10-16 19:43:00 +02:00
Tom Christie
90247afe29 Docs on Forms API 2015-10-12 21:14:58 +01:00
Tom Christie
265ec8ac62 Handle binary or unicode with JSONField 2015-09-28 17:47:51 +01:00
Tom Christie
10dbf1316f Added JSONField. Closes #3170. 2015-09-28 17:25:52 +01:00
Lubomír Sedlář
a57ad07674 Add link to validators
The `set_context` method there is the same as for the default field.
2015-09-03 10:35:28 +02:00
Lubomír Sedlář
1c049edd8c Improve documentation of default argument for fields
The documentation now not only mentions that callables are acceptable
arguments, it also tells the reader what the callable should look like.
2015-09-03 09:46:54 +02:00
Tom Christie
f4412d0827 Docs for select cutoffs 2015-08-21 10:52:44 +01:00
Aider Ibragimov
d845157983 Merge branch 'master' of https://github.com/tomchristie/django-rest-framework into feature/filepathfield 2015-07-18 23:34:07 +03:00