Commit Graph

395 Commits

Author SHA1 Message Date
Tom Christie
e8db1834d3 Added UUIDField. 2015-01-23 15:24:06 +00:00
Tom Christie
11efde8905 Merge pull request #2373 from jakul/document-translations-3.1
Document how to translate DRF error messages (version 3.1)
2015-01-09 11:57:02 +00:00
Craig Blaszczyk
58ec7669ae swap backticks for double quotes 2015-01-07 18:22:30 +00:00
Craig Blaszczyk
91e316f781 prefer single quotes in source and double quotes in user visible strings; add some missing full stops to user visible strings 2015-01-07 12:46:23 +00:00
Craig Blaszczyk
9a4267049b use double quotes in user messages 2015-01-07 12:33:37 +00:00
Craig Blaszczyk
4c32083b8b use double quotes for user visible strings; end user visible strings in full stops; add some missing translation tags 2015-01-07 12:01:11 +00:00
Tom Christie
b6ca7248eb required=False allows omission of value for output. Closes #2342 2015-01-05 14:32:12 +00:00
Craig Blaszczyk
a90ba2bc11 update error messages for language and consistency 2015-01-02 11:08:31 +00:00
Tom Christie
77e3021fea Better behaviour with null and '' for blank HTML fields. 2014-12-20 16:26:51 +00:00
Tom Christie
87ac64e41b Fixes for behavior with empty HTML fields. 2014-12-18 10:36:52 +00:00
Tom Christie
3fff5cb6e0 Fix empty HTML values when a default is provided. 2014-12-17 15:13:48 +00:00
Tom Christie
af53e34dd5 Merge pull request #2279 from tomchristie/fix-serializer-repr-unicode-bug
Use unicode internally everywhere for 'repr'.
2014-12-15 12:04:46 +00:00
Tom Christie
72e08a3e8b Use unicode internally everywhere for 'repr' 2014-12-15 11:55:17 +00:00
Tom Christie
488b13e7b8 Better messaging for 'Field.to_representation'. Closes #2271. 2014-12-15 09:29:54 +00:00
Tom Christie
aa571abb20 Better errors when serializer has incorrectly named field. 2014-12-13 14:58:04 +00:00
Peter Schmidt
fa1ef33bfc Update CharField default min_length message. 2014-12-12 11:16:29 +11:00
Tom Christie
81d0b748b4 Improve field lookup behavior for dicts/mappings. Closes #2244. Closes #2243. 2014-12-10 09:16:01 +00:00
José Padilla
afe7ed9333 Add allow_blank for ChoiceField #2184
This makes a ChoiceField optional in HTML if
model field has `blank=True` set.
2014-12-09 09:25:06 -04:00
Tom Christie
eee02a47d9 Added ListSerializer.validate(). Closes #2168. 2014-12-08 14:56:45 +00:00
Tymur Maryokhin
d54c67d79d Removed custom StringIO, force_text, smart_text compat 2014-12-04 03:11:42 +01:00
Tom Christie
d2d7e1dfde Drop Field.validate 2014-11-27 16:41:53 +00:00
Tom Christie
8579222cbd Fix for nested attribute lookups where one is a callable 2014-11-27 15:14:11 +00:00
Tom Christie
1ffe4857ec Support callable attributes in dotted source. Closes #2142. 2014-11-27 08:10:52 +00:00
Tom Christie
06fd63dade Don't use default_empty_html value for partial updates. Closes #2118. 2014-11-25 11:14:28 +00:00
Tom Christie
6794b3380a Fixes for defaulting empty HTML fields to '', None, or empty. 2014-11-20 12:15:33 +00:00
Tom Christie
e49d22dbda Allow blank choices to render. Closes #2071. 2014-11-19 09:31:26 +00:00
Tom Christie
0f508c5821 Docs for advanced default argument usage. Closes #1945 2014-11-17 18:36:32 +00:00
Tom Christie
62ce653c61 Update fields.py 2014-11-10 14:44:26 +00:00
Tom Christie
eafb7e1e24 ModelField fix. Closes #2018. 2014-11-07 11:44:16 +00:00
Tymur Maryokhin
ea76dc18b6 Fixed base_url duplication in FileField.use_url
Django already joins base_url when constructing FileField.url
2014-11-06 18:20:55 +01:00
Tom Christie
4e001dbb7a Drop usage of SortedDict. Closes #2027. 2014-11-06 12:00:30 +00:00
Tom Christie
ed541864e6 Support for bulk create. Closes #1965. 2014-11-06 10:34:59 +00:00
Tom Christie
73daf40715 ModelField should support max_length. Closes #2018. 2014-11-05 15:51:45 +00:00
Tom Christie
0a5d088287 Fix failing copy of fields when RegexValidator is used. Closes #1954. 2014-11-05 10:48:30 +00:00
Tom Christie
26b6180f50 Support None if initial part of dotted lookup returns None. Closes #1223. 2014-11-05 10:28:34 +00:00
Tom Christie
207208fedf Lazy loading of fields and validators. Closes #1963. 2014-10-31 16:38:39 +00:00
Tom Christie
bacf8cfa9d Guard against malicious string inputs for numbers. Closes #1903. 2014-10-31 15:41:00 +00:00
Tom Christie
9ebaabd6eb unique_for_date/unique_for_month/unique_for_year 2014-10-28 16:21:49 +00:00
Tom Christie
ae53fdff9c First pass at unique_for_date, unique_for_month, unique_for_year 2014-10-22 13:30:28 +01:00
Tom Christie
05cbec9dd7 Use serializers.ValidationError 2014-10-17 13:23:14 +01:00
Tom Christie
32fd82ba0d get_attribute method on fields 2014-10-16 20:47:57 +01:00
Tom Christie
b4f3379c70 Support fields that reference a simple callable 2014-10-15 15:13:28 +01:00
Tom Christie
d9a199ca0d exceptions.ValidationFailed, not Django's ValidationError 2014-10-10 14:16:09 +01:00
Tom Christie
5d247a65c8 First pass on nested serializers in HTML 2014-10-09 15:11:19 +01:00
Tom Christie
f7d43f530a Limit blank string -> None to just be on relational fields 2014-10-08 17:03:14 +01:00
Tom Christie
5ead8dc89d Support empty file fields 2014-10-08 16:59:52 +01:00
Tom Christie
093febb912 Tests for relational fields 2014-10-08 11:04:08 +01:00
Tom Christie
6bfed6f852 Enforce uniqueness validation for relational fields 2014-10-07 17:04:53 +01:00
Tom Christie
dd47d8aa45 Merge pull request #1921 from koordinates/fix-typos
Minor: fix spelling and grammar, mostly in 3.0 announcement
2014-10-03 09:24:26 +01:00
Craig de Stigter
dfab9af294 Minor: fix spelling and grammar, mostly in 3.0 announcement 2014-10-03 08:41:18 +13:00
Tom Christie
fec7c4b458 Browsable API tweaks 2014-10-02 18:13:15 +01:00
Tom Christie
df7b6fcf58 First pass on incorperating the form rendering into the browsable API 2014-10-02 16:24:24 +01:00
Tom Christie
381771731f Use six.text_type instead of str everywhere 2014-10-01 13:09:14 +01:00
Tom Christie
d1b2c8ac7f Absolute URLs for file fields 2014-09-29 14:12:26 +01:00
Tom Christie
d2d412993f .validate() on serializer fields 2014-09-29 11:24:21 +01:00
Tom Christie
43fd5a8730 Uniqueness validation 2014-09-29 09:24:03 +01:00
Tom Christie
dee3f78cb6 FileField and ImageField 2014-09-26 17:06:20 +01:00
Tom Christie
6090144608 Simplify serialization slightly 2014-09-26 14:32:44 +01:00
Tom Christie
2e87de0143 Added ListField 2014-09-26 13:08:20 +01:00
Tom Christie
2859eaf524 request.data attribute 2014-09-26 10:46:52 +01:00
Tom Christie
417fe1b675 Partial support 2014-09-25 13:37:26 +01:00
Tom Christie
3a5335f09f Fix syntax error 2014-09-25 13:12:02 +01:00
Tom Christie
8ee92f8a18 Refuse to downcast from datetime to date or time 2014-09-25 13:10:33 +01:00
Tom Christie
b47ca158b9 Check for redundant on SerializerMethodField 2014-09-25 12:09:12 +01:00
Tom Christie
64632da371 Clean up bind - no longer needs to be called multiple times in nested fields 2014-09-25 11:40:32 +01:00
Tom Christie
1420c76453 Ensure proper sorting of 'choices' attribute on ChoiceField 2014-09-25 10:49:25 +01:00
Tom Christie
fb1546ee50 Enforce field_name != source 2014-09-24 20:53:37 +01:00
Tom Christie
127c0bd3d6 Custom deepcopy on Field classes 2014-09-24 20:25:59 +01:00
Tom Christie
0404f09a7e NullBooleanField 2014-09-23 14:30:17 +01:00
Tom Christie
f22d0afc3d Tests for field choices 2014-09-23 14:15:00 +01:00
Tom Christie
5d80f7f932 allow_blank, allow_null 2014-09-22 17:46:02 +01:00
Tom Christie
5a95baf2a2 Tests & tweaks for ChoiceField 2014-09-22 16:52:57 +01:00
Tom Christie
b5454dd022 Tests and tweaks for choice fields 2014-09-22 16:50:04 +01:00
Tom Christie
e5f0a97595 More compat fixes 2014-09-22 16:45:06 +01:00
Tom Christie
5586b6581d Support format=None for date/time fields 2014-09-22 16:02:59 +01:00
Tom Christie
4db23cae21 Tweaks to DecimalField 2014-09-22 15:34:06 +01:00
Tom Christie
249253a144 Fix compat issues 2014-09-22 14:54:33 +01:00
Tom Christie
c54f394904 Ensure 'messages' in fields are respected in preference to default validator messages 2014-09-22 13:57:45 +01:00
Tom Christie
afb3f8ab0a Tests and tweaks for text fields 2014-09-22 13:26:47 +01:00
Tom Christie
af46fd6b00 Field tests and associated cleanup 2014-09-22 12:25:57 +01:00
Tom Christie
5b7e4af0d6 get_base_field() refactor 2014-09-18 11:20:56 +01:00
Tom Christie
40dc588a37 Drop label from serializer fields when not needed 2014-09-15 09:50:51 +01:00
Tom Christie
e6c88a4233 Drop usage of validatiors.EMPTY_VALUES 2014-09-12 19:54:27 +01:00
Tom Christie
79715f01f8 Coerce dates etc to ISO_8601 in seralizer, by default. 2014-09-12 12:10:22 +01:00
Tom Christie
5e39e159ee UNICODE_JSON and COMPACT_JSON settings 2014-09-12 11:38:22 +01:00
Tom Christie
250755def7 Clean up relational fields queryset usage 2014-09-12 10:59:51 +01:00
Tom Christie
0d354e8f92 to_internal_value() and to_representation() 2014-09-12 09:49:35 +01:00
Tom Christie
adcb64ab41 MethodField -> SerializerMethodField 2014-09-12 09:12:56 +01:00
Tom Christie
1e53eb0aa2 DecimalFields should still be quantized even without coerce_to_string 2014-09-11 21:57:32 +01:00
Tom Christie
040bfcc09c NotImplemented stubs for Field, and DecimalField improvements 2014-09-11 21:48:54 +01:00
Tom Christie
de301f3b66 Merge master 2014-09-11 13:20:44 +01:00
Tom Christie
80ba047347 Compat fixes 2014-09-10 16:57:22 +01:00
Tom Christie
01c8c0cad9 Added help_text argument to fields 2014-09-10 13:52:16 +01:00
Tom Christie
234369aefd Tweaks 2014-09-10 08:53:33 +01:00
Tom Christie
b1c07670ca Fleshing out serializer fields 2014-09-09 17:46:28 +01:00
Tom Christie
21980b800d More test sorting 2014-09-08 14:24:05 +01:00
Christopher Adams
613a301a36 Fixed #1533 - Resolved issue with integer keys on nested choices never validating.
- Added unit test for nested `choices` argument.
- Added unit test for non-nested `choices` argument.
2014-09-06 17:13:28 -04:00
Tom Christie
d934824bff Workin on 2014-09-05 16:29:46 +01:00
Piotr Jakimiak
c3b841ae44 Use Serializer instead of ModelSerializer 2014-09-05 14:08:11 +02:00
Piotr Jakimiak
6022b9ddd4 Fix comment 2014-09-05 12:00:17 +02:00