Commit Graph

395 Commits

Author SHA1 Message Date
Tom Christie
0ccb148183 Support QueryDict list arguments with ListField. Closes #3155. 2015-07-16 15:59:15 +01:00
Tom Christie
264d423493 Added allow_empty flag for ListField, ListSerializer, ManyRelation, MultipleChoiceField. 2015-07-16 13:51:15 +01:00
Tom Christie
d231f36588 Support default values being used for empty HTML fields. Closes #3130. 2015-07-16 11:47:40 +01:00
Tom Christie
c4f908d4ee Introduce datetime_parser as class level attribute on all date/time fields. Refs #3093. 2015-07-02 11:23:52 +01:00
Tom Christie
6ce9e3baf0 Remove datetime_parser argument from DateTimeField 2015-07-02 11:22:18 +01:00
Tom Christie
6d79ea2cde Merge pull request #3093 from sorreltree/master
Ability to customize DateTimeField with a custom datetime_parser
2015-07-02 11:21:25 +01:00
Tom Christie
d979dc6522 Tweak exception message 2015-07-02 10:16:43 +01:00
Tom Christie
e3c3d8826f Merge pull request #3071 from antonyc/patch-1
Made exception message more verbose
2015-07-02 10:14:01 +01:00
Michael Bacon
5f40ab53de Ability to customize DateTimeField with a custom datetime_parser 2015-06-30 14:51:47 -04:00
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
José Padilla
83c9136c90 Cleanup import following PEP 8 style guide 2015-06-25 16:10:17 -04:00
Tom Christie
321133242f Unsaved file objects may not have an associated URL. 2015-06-24 14:24:19 +01:00
Tom Christie
39ece9bee0 Support allow_blank=False with trim_whitespace=True. 2015-06-24 13:32:54 +01:00
Anton Chaporgin
47acec0f9d Made exception message more verbose
This exception helps you to upgrade from 2 -> 3 and since a lot of fields may be in 2 using serializers.Field as parent class, this message should contain at least name of upgraded field to help user to grep and fix the codebase faster.
2015-06-24 11:59:49 +03:00
Tom Christie
a3d6601e09 Merge pull request #3008 from linovia/feature/ipaddress-fix
`IPAddressField` improvements
2015-06-04 14:54:50 +01:00
Tom Christie
e8cc948f6b Merge pull request #2695 from delinhabit/refactor-decimalfield
[enhancement] Refactored DecimalField to allow easier subclassing
2015-06-04 14:26:28 +01:00
Xavier Ordoquy
dee5fb5647 Merge remote-tracking branch 'reference/master' into feature/ipaddress-fix
Conflicts:
	docs/api-guide/fields.md
2015-06-04 14:21:33 +01:00
Xavier Ordoquy
0c66c7cfa6 Merge pull request #3000 from linovia/ovangle/uuid_format2
Add 'format' argument to UUIDField
2015-06-03 12:32:23 +01:00
Xavier Ordoquy
f8eacc5bc0 Merge pull request #2993 from linovia/bug/2894
MultipleChoiceField empties incorrectly on a partial update using multipart/form-data (#2894)
2015-06-01 17:48:20 +01:00
Nicolas Delaby
f701ecceb7 Add DurationField 2015-06-01 18:20:53 +02:00
Xavier Ordoquy
5c90bf9cc0 Fix for #2894 thanks to @carljm 2015-06-01 16:13:35 +01:00
Michał Hernas
e8c226c2db Fixed lint problems 2015-05-18 16:55:40 +02:00
Michał Hernas
069ea31cfb Added test ensuring DecimalField accepts 2E+2 as 200 and validates
decimal place correctly.
2015-05-18 16:42:24 +02:00
David Sanders
b7edd46313 Use simpler dict.get() rather than try/except 2015-05-16 01:01:27 +10:00
David Sanders
8e84a9f6d0 Allow invalid outputs to pass through to_representation() for ChoiceField & MultipleChoiceField 2015-05-15 18:59:10 +10:00
Ryan Allen
cbea03c85b DateField to_representation can handle str and empty values. Fixes #2656, #2687. 2015-04-23 19:31:46 -05:00
Ryan Allen
32acc4a72b Set IntegerField class variable for compiled decimal regex, comment for purpose 2015-04-21 10:52:52 -04:00
Ryan Allen
1f10a39d31 Match IntegerField validation with Django's, preventing decimal values being stored as ints, fixes #2835.
Match IntegerField validation with Django IntegerField, prevents decimal values being stored as ints, fixes #2835
 On branch master
2015-04-20 11:03:05 -04:00
Thomas Stephenson
236b731072 Add 'format' argument to UUIDField
To allow serializations to control the representation format of a
UUID value
2015-04-12 22:07:25 +10:00
Andrea Grandi
d6effbf779 Remove unpack_ipv4 parameter 2015-04-02 19:40:17 +01:00
Michael Blatherwick
56ec7b152e Fixed docstring typo 2015-03-27 18:00:19 +00:00
Andrea Grandi
466575bee6 Lowercase the input 2015-03-26 18:14:53 +00:00
Ion Scerbatiuc
022c4d540b Refactored DecimalField to allow easier subclassing 2015-03-14 07:16:17 -07:00
Aider Ibragimov
c44376c613 remove unnecessary check 2015-03-04 14:17:58 +03:00
Tymur Maryokhin
391b0ae21b Call default.set_context() only on create. Refs #2619. 2015-03-03 17:02:12 +01:00
Aider Ibragimov
de72022f80 Merge branch 'master' of https://github.com/Ins1ne/django-rest-framework into feature/ipaddress 2015-02-28 14:29:27 +03:00
Aider Ibragimov
4d5eee04a0 add IPAddressField, update docs 2015-02-28 10:11:38 +03:00
Kevin Wood
78e8b1b010 Updated CreateOnlyDefault to call set_context on its default (if callable) 2015-02-27 22:14:15 -08:00
Janusz Harkot
9098856d46 fix DictKey initial value 2015-02-27 19:46:36 +01:00
Tom Christie
cda74b5997 Merge pull request #2608 from ezheidtmann/dont-swallow-errors-in-callable-sources
Dont swallow errors in callable sources
2015-02-27 09:13:01 +00:00
Evan Heidtmann
e6b06c34c1 Add explanation for this exception mutation 2015-02-26 09:20:17 -08:00
Evan Heidtmann
bdb73d5588 Avoid swallowing exceptions thrown in callable attributes 2015-02-26 09:05:46 -08:00
Rense VanderHoek
91416632a8 DecimalField fix
max_value and min_value are not in kwargs
2015-02-21 12:31:37 +01:00
Rense VanderHoek
9cb547b85f Validator-fix, added min/max fields to test_metadata 2015-02-20 17:34:49 +01:00
Rense VanderHoek
c8609ba652 Set field length/values as actual attributes.
The SimpleMetadata class in metadata.py tries to getattr() attributes
on a field. For this to work, max_length and min_length have to be
actually set as an attribute.
Did the same for min_value and max_value and added those two to
SimpleMetadata.get_field_info
2015-02-20 16:31:12 +01:00
Tom Christie
c3425accde Fix incorrect HTML parsing for DictField 2015-02-11 14:19:07 +00:00
Tom Christie
dec3493d7c Minor cleanup 2015-02-06 14:43:43 +00:00
José Padilla
7f801b9a01 Add trim_whitespace to CharField #2517
If set to `True` then leading and trailing
whitespace is trimmed. Defaults to `True`.
2015-02-06 01:09:19 -04:00
Tom Christie
4ee4b4f2dc Merge master 2015-01-30 14:00:25 +00:00
Tom Christie
35f6a82462 Added DictField and support for HStoreField. 2015-01-23 16:27:23 +00:00