summaryrefslogtreecommitdiff
path: root/django/db/models/fields
AgeCommit message (Collapse)Author
2015-11-23[1.8.x] Fixed #25786 -- Fixed set_FOO_order() crash with ↵Tim Graham
order_with_respect_to referencing OneToOneField pk. Partial backport of 7bec480fe2ace94c8e7f0c88485442bfa74436b4 from master
2015-10-25[1.8.x] Fixed #24979 -- Removed usage of inspect.getargspec().Tim Graham
Backport of 3872a33132a4bb6aa22b237927597bbfdf6f21d7 from master
2015-10-13[1.8.x] Fixed #24156 -- Fixed inherited related name of ManyToManyField.Andriy Sokolovskiy
Fixed situation when parent abstract model declares related_name='+' and child models had an invalid queryset. Backport of f7b297815819153b53dc1125d3f42869fb1b7ebc from master
2015-10-06[1.8.x] Fixed #25503 -- Fixed system check crash on ForeignKey to abstract ↵Mariusz Felisiak
model. Backport of 914167abf19d16ac97c0f1f6ae1b08cb377c8f3a from master
2015-09-30[1.8.x] Fixed #24505 -- Fixed clash with hidden m2m fields.Marco Fucci
Added support for multiple m2m fields with the same 'to' model and with related_name set to '+'. Backport of 4ee08958f154594b538207a53c1d457687b3f7ae from master
2015-09-19[1.8.x] Fixed #25160 (again) -- Moved data loss check on reverse relations.Aymeric Augustin
Moved data loss check when assigning to a reverse one-to-one relation on an unsaved instance to Model.save(). This is exactly the same change as e4b813c but for reverse relations. Backport of c3904de from master
2015-08-10[1.8.x] Fixed #25160 -- Moved unsaved model instance data loss check to ↵Tim Graham
Model.save() This mostly reverts 5643a3b51be338196d0b292d5626ad43648448d3 and 81e1a35c364e5353d2bf99368ad30a4184fbb653. Thanks Carl Meyer for review. Backport of 5980b05c1fad69eef907e0076aa2dc837edab529 from master
2015-06-26[1.8.x] Fixed #25016 -- Reallowed non-ASCII values for ↵薛丞宏
ForeignKey.related_name on Python 3. Backport of d3e12c901777697b7bf08b25e2dd46f0b951db8c from master
2015-06-23[1.8.x] Renamed RemovedInDjango20Warning to RemovedInDjango110Warning.Tim Graham
2015-06-15[1.8.x] Fixed #24912 -- Fixed prefetch_related failure for UUIDField primary ↵Brian King
keys This resolves a problem on databases besides PostgreSQL when using prefetch_related with a source model that uses a UUID primary key. Backport of bfb5b7150ff52571a7a3cf10e0dd0d1dbd45c4b5 from master
2015-06-02[1.8.x] Fixed #24831 -- Fixed pickling queryset with prefetch_related() ↵Andriy Sokolovskiy
after deleting objects. Backport of 2913d6b77d8b2082dc79df5503b7dd3ddd05fcc1 from master
2015-05-12[1.8.x] Fixed #24698, #24712 -- Added ForeignKey.get_db_prep_value()Abhaya Agarwal
Fixed crashes with ForeignKey to UUIDField and inheritance with UUIDField primary keys.
2015-03-18[1.8.x] Fixed #24495 -- Allowed unsaved model instance assignment check to ↵Karl Hobley
be bypassed. Backport of 81e1a35c364e5353d2bf99368ad30a4184fbb653 from master
2015-02-23[1.8.x] Fixed #24381 -- removed ForeignObjectRel opts and to_optsAnssi Kääriäinen
These cached properies were causing problems with pickling, and in addition they were confusingly defined: field.rel.model._meta was not the same as field.rel.opts. Instead users should use field.rel.related_model._meta inplace of field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts. Backport of f95122e541df5bebb9b5ebb6226b0013e5edc893 from master
2015-02-21[1.8.x] Fixed #24376 -- added verbose_name arg to UUIDFieldMichael Angeletti
Backport of ea3168dc6ced391d848c511a14cfcecfeac9d401 from master
2015-02-20[1.8.x] Fixed typo in django/db/models/fields/files.py comment.Don Kirkby
Backport of 99a1bbf9853e0b06385d7f221a90828e6c060132 from master
2015-02-20[1.8.x] Update converters to take a consistent set of parameters.Marc Tamlyn
As suggested by Anssi. This has the slightly strange side effect of passing the expression to Expression.convert_value has the expression passed back to it, but it allows more complex patterns of expressions. Backport of 32d4db66b9 from master
2015-02-20[1.8.x] Fixed #24343 -- Ensure db converters are used for foreign keys.Marc Tamlyn
Joint effort between myself, Josh, Anssi and Shai. Conflicts: django/db/models/query.py tests/model_fields/models.py Backport of 4755f8fc25331c739a6f932cc8aba0cc9e62e352 from master.
2015-02-14[1.8.x] Fixed #24289 -- Reversed usage of Field.many_to_one and one_to_many.Loic Bistuer
Thanks Carl Meyer and Tim Graham for the reviews and to all involved in the discussion. Backport of 18c0aaa9123579375294fcc4a8ee7e3530176b88 from master
2015-02-13[1.8.x] Fixed #24319 -- Added validation for UUID model fieldJosh Smeaton
Backport of de0241eb985c6dec978beda119fee353ef3e9604 from master
2015-02-09[1.8.x] Sorted imports with isort; refs #23860.Tim Graham
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
2015-02-09[1.8.x] Fixed #24302 -- Added DurationField.formfield()Tim Graham
Backport of 2d7c27d3870e57edd1b2ac46b49f0a8804753a1e from master
2015-02-05[1.8.x] Added UUIDField.deconstruct()Tim Graham
Backport of 0f54cf28c09a80254571487e3af93be2096cfdac from master
2015-02-03[1.8.x] Fixed #23617 -- Added get_pk_value_on_save()Anssi Kääriäinen
The method is mainly intended for use with UUIDField. For UUIDField we want to call the field's default even when primary key value is explicitly set to None to match the behavior of AutoField. Thanks to Marc Tamlyn and Tim Graham for review. Backport of 8adc59038cdc6ce4f9170e4de2d716d940e136b3 from master
2015-01-29[1.8.x] Fixed #23940 -- Allowed model fields to be named `exact`.Simon Charette
An explicit `__exact` lookup in the related managers filters was interpreted as a reference to a foreign `exact` field. Thanks to Trac alias zhiyajun11 for the report, Josh for the investigation, Loïc for the test name and Tim for the review. Backport of eb4cdfbdd64a95b303eaaa40a070521aa58362fd from master
2015-01-29[1.8.x] Removed ForeignObjectRel.get_lookup_constraint() [unused].Tim Graham
Backport of f60973111806100d284d41c12206c04740063549 from master
2015-01-16Fixed #24092 -- Widened base field support for ArrayField.Marc Tamlyn
Several issues resolved here, following from a report that a base_field of GenericIpAddressField was failing. We were using get_prep_value instead of get_db_prep_value in ArrayField which was bypassing any extra modifications to the value being made in the base field's get_db_prep_value. Changing this broke datetime support, so the postgres backend has gained the relevant operation methods to send dates/times/datetimes directly to the db backend instead of casting them to strings. Similarly, a new database feature has been added allowing the uuid to be passed directly to the backend, as we do with timedeltas. On the other side, psycopg2 expects an Inet() instance for IP address fields, so we add a value_to_db_ipaddress method to wrap the strings on postgres. We also have to manually add a database adapter to psycopg2, as we do not wish to use the built in adapter which would turn everything into Inet() instances. Thanks to smclenithan for the report.
2015-01-12Fixed #9893 -- Allowed using a field's max_length in the Storage.Pavel Shpilev
2015-01-10Move % addition to lookups, refactor postgres lookups.Marc Tamlyn
These refactorings making overriding some text based lookup names on other fields (specifically `contains`) much cleaner. It also removes a bunch of duplication in the contrib.postgres lookups.
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2015-01-07Refs #2443 -- Allowed creation of objects with NULL DurationFieldsMichał Modzelewski
2015-01-07Fixed #24078 -- Removed empty strings from GenericIPAddressFieldJosh Smeaton
2015-01-06Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
2015-01-05Fixed #23861 -- Added an API to deprecate model fields.Tim Graham
Thanks Markus Holterman and Berker Peksag for review.
2015-01-02Fixed #9104 -- Moved FieldDoesNotExist to core.exceptionsDaniel Pyrathon
2015-01-01Fixed #23891 -- Moved deprecation of IPAddressField to system check framework.Tim Graham
Thanks Markus Holtermann for review.
2014-12-31Moved DatabaseCreation.data_types properties to DatabaseWrapper.Tim Graham
refs #22340.
2014-12-23Removed models.Field.bind() -- unused/undocumented since at least 1.0.Tim Graham
2014-12-23Fixed #21414 -- Removed RelatedObject and deprecated Field.related.Anssi Kääriäinen
2014-12-23Refs #2443 -- Move the durationfield converter logic.Marc Tamlyn
This reduces how frequently this logic is run significantly. Thanks to Anssi for the suggestion.
2014-12-23Fixed #24033 -- Use interval type on Oracle.Marc Tamlyn
Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review.
2014-12-20Fixed #2443 -- Added DurationField.Marc Tamlyn
A field for storing periods of time - modeled in Python by timedelta. It is stored in the native interval data type on PostgreSQL and as a bigint of microseconds on other backends. Also includes significant changes to the internals of time related maths in expressions, including the removal of DateModifierNode. Thanks to Tim and Josh in particular for reviews.
2014-12-12Fixed #23455 -- Accept either bytes or text for related_name, convert to text.Carl Meyer
2014-12-12Revert "Fixed #23455 -- Forced related_name to be a unicode string during ↵Carl Meyer
deconstruction." This reverts commit 45bd7b3bd9008941580c100b9fc7361e3ff3ff0d.
2014-12-12Fixed #23941 -- Removed implicit decimal formatting from expressions.Josh Smeaton
2014-12-09Remove text-mangling of default values.Marc Tamlyn
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-11-27Fixed #23338 -- Added warning when unique=True on ForeigKeyDiego Guimarães
Thanks Jonathan Lindén for the initial patch, and Tim Graham and Gabe Jackson for the suggestions.
2014-11-26Fixed #23801 -- Added warning when max_length is used with IntegerFieldMattBlack85
2014-11-26Adjusted a comment to reflect some app refactor changes.Simon Charette