summaryrefslogtreecommitdiff
path: root/django/db/models/fields
AgeCommit message (Collapse)Author
2015-02-12Refs #24215 -- Prevented pending lookup pollution by abstract models.Simon Charette
2015-02-09Fixed #24302 -- Added DurationField.formfield()Tim Graham
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-05Added UUIDField.deconstruct()Tim Graham
2015-02-05Fix small regression caused by 71ada3a8e689a883b5ffdeb1744ea16f176ab730.Loic Bistuer
During direct assignment, evaluating the iterable before the transaction is started avoids leaving the transaction dirty if an exception is raised. This is slightly more wasteful but probably not enough to warrant a change of behavior. Thanks Anssi for the feedback. Refs #6707.
2015-02-05Fixed #6707 -- Added RelatedManager.set() and made descriptors' __set__ use it.Loic Bistuer
Thanks Anssi Kääriäinen, Carl Meyer, Collin Anderson, and Tim Graham for the reviews.
2015-02-04Removed EverythingNodeAnssi Kääriäinen
At the same time, made sure that empty nodes in where clause match everything.
2015-02-03Fixed #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.
2015-01-29Fixed #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.
2015-01-29Removed ForeignObjectRel.get_lookup_constraint() [unused].Tim Graham
2015-01-27Fixed #24210 -- Cleaned up relational fields __init__().Loic Bistuer
Thanks Collin Anderson and Tim Graham for the reviews.
2015-01-19Removed IPAddressField per deprecation timeline; refs #20439.Tim Graham
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
2014-11-21Fixed #23862 -- Made ManyToManyRel.get_related_field() respect to_field.Simon Charette
2014-11-16Renamed qn to compilerJosh Smeaton
2014-11-15Fixed #14030 -- Allowed annotations to accept all expressionsJosh Smeaton
2014-11-12Remove Field.get_validator_unique_lookup_type()Tim Graham
Usage of this method was removed pre 1.0 (c2ba59fc).
2014-11-03Fixed typos using https://github.com/vlajos/misspell_fixerVeres Lajos
2014-11-03Fixed #23420 - broken warning for unbound naive datetime objectsAndy Chosak
Fixed issue with warning message displayed for unbound naive datetime objects when USE_TZ is True. Adds unit test that demonstrates the issue (discoverable when using a custom lookup in MySQL).
2014-10-19Fixed #23684 -- Used correct package name for Pillow in Error hint.Nicholas Serra
2014-10-08Fixed #23611 -- update_or_create failing from a related managerLoic Bistuer
Added update_or_create to RelatedManager, ManyRelatedManager and GenericRelatedObjectManager. Added missing get_or_create to GenericRelatedObjectManager.
2014-10-04Fixed #22064 -- Add check for related_nameAndré Ericson
Validates that related_name is a valid Python id or ends with a '+' and it's not a keyword. Without a check it passed silently leading to unpredictable problems. Thanks Konrad Świat for the initial work.
2014-09-29Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.Thomas Chaumeny
Thanks Collin Anderson for the review.
2014-09-25Fixed #23455 -- Forced related_name to be a unicode string during ↵Markus Holtermann
deconstruction.
2014-09-24Fixed #23550 -- Normalized get_queryset() of RelatedObjectDescriptorLoic Bistuer
and ReverseSingleRelatedObjectDescriptor so they actually return QuerySet instances. Also ensured that SingleRelatedObjectDescriptor.get_queryset() accounts for use_for_related_fields=True. This cleanup lays the groundwork for #23533. Thanks Anssi Kääriäinen for the review.
2014-09-16Fixed #19463 -- Added UUIDFieldMarc Tamlyn
Uses native support in postgres, and char(32) on other backends.
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.