Commit Graph

117 Commits

Author SHA1 Message Date
Tim Graham a4c20ae85b Refs #24227 -- Fixed crash of ManyToManyField.value_from_object() on unsaved model instances.
This behavior was removed in 67d984413c
but is needed to prevent a crash in formtools.
2016-05-28 15:41:47 -04:00
Claude Paroz 388bb5bd9a Fixed #22936 -- Obsoleted Field.get_prep_lookup()/get_db_prep_lookup()
Thanks Tim Graham for completing the initial patch.
2016-05-04 20:02:01 +02:00
Cristiano 914c72be2a Fixed #26058 -- Delegated os.path bits of FileField's filename generation to the Storage. 2016-04-30 17:22:40 -04:00
Joshua Phillips 4681d65048 Fixed #26557 -- Converted empty strings to None when saving GenericIPAddressField. 2016-04-29 10:11:49 -04:00
Michal Petrucha c339a5a6f7 Refs #16508 -- Renamed the current "virtual" fields to "private".
The only reason why GenericForeignKey and GenericRelation are stored
separately inside _meta is that they need to be cloned for every model
subclass, but that's not true for any other virtual field. Actually,
it's only true for GenericRelation.
2016-04-13 10:10:53 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Tim Graham 3c1b572f18 Split model_fields tests into different files. 2016-03-23 19:31:47 -04:00
Tim Graham 4f0cd0fd16 Fixed #26324 -- Fixed DurationField with fractional seconds on SQLite. 2016-03-10 12:18:29 -05:00
Simon Charette 0223e213dd Fixed #26186 -- Documented how app relative relationships of abstract models behave.
This partially reverts commit bc7d201bdb.

Thanks Tim for the review.

Refs #25858.
2016-02-29 22:07:05 -05:00
Hasan 253adc2b8a Refs #26022 -- Used context manager version of assertRaisesMessage in tests. 2016-01-29 13:03:39 -05:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Simon Charette bc7d201bdb Fixed #25858 -- Bound abstract model application relative relationships.
Thanks to Karl Hobley for the report and Markus, Shai, Aymeric for their input
and Tim for the review.
2016-01-11 12:23:23 -05:00
Simon Charette a08fda2111 Fixed #25746 -- Isolated inlined test models registration.
Thanks to Tim for the review.
2016-01-06 20:00:07 -05:00
Attila Tovt 6f229048dd Fixed #25547 -- Made Model.refresh_from_db() update FileField's instance. 2015-12-05 17:23:13 -05:00
Josh Soref 93452a70e8 Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
George Marshall 710e11d076 Fixed #25767 -- Fixed data truncation possibility with Positive(Small)IntegerField on MySQL. 2015-11-24 11:09:15 -05:00
Alex Hill 134ca4d438 Fixed #24509 -- Added Expression support to SQLInsertCompiler 2015-09-22 23:35:24 +10:00
Iulia Chiriac 75ed590032 Fixed #24636 -- Added model field validation for decimal places and max digits. 2015-09-18 14:30:20 -04:00
Dražen Odobašić b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Aymeric Augustin b799a50c8e Serialized some tests that interact with the filesystem.
Considering the APIs exercised by these test cases, it's hard to make
them independent.
2015-09-09 23:01:17 +02:00
Tim Graham 064d4b1cb0 Fixed #25320 -- Reverted ManyToManyField.null to False for backwards compatibility.
Thanks Tom Christie for the report and review.
2015-09-01 07:59:39 -04:00
Maxime Lorant 5153a3bfdc Fixed #25331 -- Removed trailing blank lines in docstrings. 2015-08-31 17:37:21 -04:00
Tim Graham 5980b05c1f Fixed #25160 -- Moved unsaved model instance data loss check to Model.save()
This mostly reverts 5643a3b51b and
81e1a35c36.

Thanks Carl Meyer for review.
2015-08-10 08:51:32 -04:00
Tim Graham 770449e24b Removed unused Field.get_flatchoices() method.
Unused since c2ba59fc1d (Django 1.0).

Thanks Andy Baker for the report.
2015-08-03 13:08:24 -04:00
Flavio Curella c2e70f0265 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 2015-07-27 18:28:13 -04:00
Tim Graham b60375d4bb Fixed #25129 -- Made model instance defaults work with migrations (refs #24919). 2015-07-21 09:19:40 -04:00
Edward Henderson f8cc464452 Fixed #16501 -- Added an allow_unicode parameter to SlugField.
Thanks Flavio Curella and Berker Peksag for the initial patch.
2015-07-17 13:48:58 -04:00
Tim Graham 47fcbe506c Fixed flake8 warnings on Python 3. 2015-06-15 11:27:09 -04:00
Cole Maclean 20ff296cb1 Fixed #24859 -- Made QuerySet.get() with UUIDField raise TypeError on bad value.
For consistency with AutoField.
2015-06-06 19:46:05 -04:00
Rolo 19e67c6cd1 Fixed #24677 -- Made TextField.to_python() return a string.
This is consistent with CharField.
2015-06-04 09:02:54 -04:00
Jon Dufresne 44f3ee7716 Fixed #9596 -- Added date transform for DateTimeField. 2015-06-02 08:49:10 -04:00
Simon Charette be67400b47 Refs #24652 -- Used SimpleTestCase where appropriate. 2015-05-20 13:46:13 -04:00
Abhaya Agarwal 7c7b855106 [1.8.x] Refs #24698, #24712 -- Forwardported ForeignKey.get_db_prep_value() test and release notes.
Fixed in master by b68212f539.

Forwardport of 290c9d6654 from stable/1.8.x
2015-05-12 19:42:42 -04:00
Alasdair Nicol eaeea6f947 Fixed #24714 -- Used more specific assertions than assertEqual in tests. 2015-04-28 09:31:04 -04:00
Alasdair Nicol d91321e8be Used assertIsInstance in tests. 2015-04-27 08:40:36 -04:00
Yoong Kang Lim 36eab95e7f Fixed #24667 --- Repaired model_fields cardinality test 2015-04-20 09:40:01 -04:00
Jon Dufresne 97bb48d9ba Fixed model_fields tests to use django TestCase. 2015-04-15 08:19:25 -04:00
Jay Wineinger 923da0274a Fixed #24611 -- Fixed update() crash with related UUID pk object. 2015-04-13 12:18:24 -04:00
Alex Hill 720ff740e7 Fixed #24215 -- Refactored lazy model operations
This adds a new method, Apps.lazy_model_operation(), and a helper function,
lazy_related_operation(), which together supersede add_lazy_relation() and
make lazy model operations the responsibility of the App registry. This
system no longer uses the class_prepared signal.
2015-03-25 16:48:17 -04:00
Anssi Kääriäinen 8f30556329 Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.

In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
2015-03-25 08:16:12 -04:00
David Szotten 80e3444eca Fixed #24483 -- Prevented keepdb from breaking with generator choices.
If Field.choices is provided as an iterator, consume it in __init__ instead
of using itertools.tee (which ends up holding everything in memory
anyway). Fixes a bug where deconstruct() was consuming the iterator but
bypassing the call to `tee`.
2015-03-24 11:42:53 -04:00
Aymeric Augustin 934400759d Guaranteed removal of temporary files during tests.
Dropped the DJANGO_TEST_TEMP_DIR environment variable.

Before this change, proper removal depended on the developer passing
dir=os.environ['DJANGO_TEST_TMP_DIR'] to tempfile functions.
2015-02-23 16:55:26 +01:00
Michael Angeletti ea3168dc6c Fixed #24376 -- added verbose_name arg to UUIDField 2015-02-21 13:27:49 -05:00
Marc Tamlyn 4755f8fc25 Fixed #24343 -- Ensure db converters are used for foreign keys.
Joint effort between myself, Josh, Anssi and Shai.
2015-02-20 11:35:51 +00:00
Loic Bistuer 18c0aaa912 Fixed #24289 -- Reversed usage of Field.many_to_one and one_to_many.
Thanks Carl Meyer and Tim Graham for the reviews and to all involved
in the discussion.
2015-02-14 02:28:24 +07:00
Josh Smeaton de0241eb98 Fixed #24319 -- Added validation for UUID model field 2015-02-13 09:45:53 +11:00
Simon Charette 9239f1dda7 Refs #24215 -- Prevented pending lookup pollution by abstract models. 2015-02-12 13:07:09 -05:00
Tim Graham 2d7c27d387 Fixed #24302 -- Added DurationField.formfield() 2015-02-09 10:20:01 -05:00
Collin Anderson db77915c9f Fixed E265 comment style 2015-02-06 09:30:35 -05:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00