summaryrefslogtreecommitdiff
path: root/docs/ref/models
AgeCommit message (Collapse)Author
2014-01-19Implement swappable model support for migrationsAndrew Godwin
2014-01-18Fixed typos spotted by Claude ParozAnssi Kääriäinen
2014-01-18Fixed #16187 -- refactored ORM lookup systemAnssi Kääriäinen
Allowed users to specify which lookups or transforms ("nested lookus") are available for fields. The implementation is now class based. Squashed commit of the following: commit fa7a7195f1952a9c8dea7f6e89ee13f81757eda7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 18 10:53:24 2014 +0200 Added lookup registration API docs commit eb1c8ce164325e0d8641f14202e12486c70efdb6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Tue Jan 14 18:59:36 2014 +0200 Release notes and other minor docs changes commit 11501c29c9352d17f22f3a0f59d3b805913dedcc Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 20:53:03 2014 +0200 Forgot to add custom_lookups tests in prev commit commit 83173b960ea7eb2b24d573f326be59948df33536 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:59:12 2014 +0200 Renamed Extract -> Transform commit 3b18d9f3a1bcdd93280f79654eba0efa209377bd Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:51:53 2014 +0200 Removed suggestion of temporary lookup registration from docs commit 21d0c7631c161fc0c67911480be5d3f13f1afa68 Merge: 2509006 f2dc442 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 09:38:23 2014 -0800 Merge pull request #2 from mjtamlyn/lookups_3 Reworked custom lookups docs. commit f2dc4429a1da04c858364972eea57a35a868dab4 Author: Marc Tamlyn <marc.tamlyn@gmail.com> Date: Sun Jan 12 13:15:05 2014 +0000 Reworked custom lookups docs. Mostly just formatting and rewording, but also replaced the example using ``YearExtract`` to use an example which is unlikely to ever be possible directly in the ORM. commit 250900650628d1f11beadb22814abd666029fb81 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 13:19:13 2014 +0200 Removed unused import commit 4fba5dfaa022653ffa72497258ffd8f8b7476f92 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:34:41 2014 +0200 Added docs to index commit 6d53963f375c77a1f287833b19b976d23f36c30b Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:10:24 2014 +0200 Dead code removal commit f9cc0390078e21f1ea5a7bc1f15b09f8f6b0904d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 19:00:43 2014 +0200 A new try for docs commit 33aa18a6e3c831930bda0028222a26f9c1d96e66 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:57:12 2014 +0200 Renamed get_cols to get_group_by_cols commit c7d5f8661b7d364962bed2e6f81161c1b4f1bcc3 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:45:53 2014 +0200 Altered query string customization for backends vendors The new way is trying to call first method 'as_' + connection.vendor. If that doesn't exist, then call as_sql(). Also altered how lookup registration is done. There is now RegisterLookupMixin class that is used by Field, Extract and sql.Aggregate. This allows one to register lookups for extracts and aggregates in the same way lookup registration is done for fields. commit 90e7004ec14e15503f828cc9bde2a7dab593814d Merge: 66649ff f7c2c0a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:21:01 2014 +0200 Merge branch 'master' into lookups_3 commit 66649ff891c7c73c7eecf6038c9a6802611b5d8a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:16:01 2014 +0200 Some rewording in docs commit 31b8faa62714b4b6b6057a9f5cc106c4dd73caab Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 29 15:52:29 2013 +0200 Cleanup based on review comments commit 1016159f34674c0df871ed891cde72be8340bb5d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 18:37:04 2013 +0200 Proof-of-concept fix for #16731 Implemented only for SQLite and PostgreSQL, and only for startswith and istartswith lookups. commit 193cd097ca8f2cc6a911e57b8e3fb726f96ee6a6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 17:57:58 2013 +0200 Fixed #11722 -- iexact=F() produced invalid SQL commit 08ed3c3b49e100ed9019831e770c25c8f61b70f9 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:59:52 2013 +0200 Made Lookup and Extract available from django.db.models commit b99c8d83c972786c6fcd0e84c9e5cb08c1368300 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:06:29 2013 +0200 Fixed review notes by Loic commit 049eebc0703c151127f4f0265beceea7b8b39e72 Merge: ed8fab7 b80a835 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:53:10 2013 +0200 Merge branch 'master' into lookups_3 Conflicts: django/db/models/fields/__init__.py django/db/models/sql/compiler.py django/db/models/sql/query.py tests/null_queries/tests.py commit ed8fab7fe8867ff3eb801c3697a426478387bb2f Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:47:23 2013 +0200 Made Extracts aware of full lookup path commit 27a57b7aed91b2f346abc4a77da838bffa17c727 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:10:11 2013 +0200 Removed debugger import commit 074e0f5aca0572e368c11e6d2c73c9026e7d63d7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:02:16 2013 +0200 GIS lookup support added commit 760e28e72bae475b442b026650969b0d182dbe53 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 20:04:31 2013 +0200 Removed usage of Constraint, used Lookup instead commit eac47766844b90e7d3269e7a8c012eee34ec0093 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:22:30 2013 +0200 Minor cleanup of Lookup API commit 2adf50428d59a783078b0da3d5d035106640c899 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:14:19 2013 +0200 Added documentation, polished implementation commit 32c04357a87e3727a34f8c5e6ec0114d1fbbb303 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:10:15 2013 +0200 Avoid OrderedDict creation on lookup aggregate check commit 7c8b3a32cc17b4dbca160921d48125f1631e0df4 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:04:34 2013 +0200 Implemented nested lookups But there is no support of using lookups outside filtering yet. commit 4d219d4cdef21d9c14e5d6b9299d583d1975fcba Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Wed Nov 27 22:07:30 2013 +0200 Initial implementation of custom lookups
2014-01-16Fixed #18285 -- Documented that bulk_create doesn't work with M2M relationships.Tim Graham
2014-01-16Fixed #21343 -- Noted many-to-many restrictions with intermediate model.Tim Graham
Thanks EvilDMP for the report.
2014-01-01Updated release notes on app_label.Aymeric Augustin
Django determines automatically which application models belong to, provided the application can be imported without importing models.
2013-12-18Fixed #21632 -- Docs: Removed example with callable as query parameterKevin Christopher Henry
Using callables as query parameters is undocumented and not working, so this changes an example from the ForeignKey.limit_choices_to documentation that uses it.
2013-12-18Fixed #21552 -- Allowed the use of None for the iexact lookup.Denis Moskalets
Thanks Anubhav Joshi for the documentation.
2013-12-15Fix docs typoAndrew Godwin
2013-11-27Added a bulk option to RelatedManager remove() and clear() methodsLoic Bistuer
Refs #21169
2013-11-27Fixed #21169 -- Reworked RelatedManager methods use default filteringLoic Bistuer
The `remove()` and `clear()` methods of the related managers created by `ForeignKey`, `GenericForeignKey`, and `ManyToManyField` suffered from a number of issues. Some operations ran multiple data modifying queries without wrapping them in a transaction, and some operations didn't respect default filtering when it was present (i.e. when the default manager on the related model implemented a custom `get_queryset()`). Fixing the issues introduced some backward incompatible changes: - The implementation of `remove()` for `ForeignKey` related managers changed from a series of `Model.save()` calls to a single `QuerySet.update()` call. The change means that `pre_save` and `post_save` signals aren't called anymore. - The `remove()` and `clear()` methods for `GenericForeignKey` related managers now perform bulk delete so `Model.delete()` isn't called anymore. - The `remove()` and `clear()` methods for `ManyToManyField` related managers perform nested queries when filtering is involved, which may or may not be an issue depending on the database and the data itself. Refs. #3871, #21174. Thanks Anssi Kääriäinen and Tim Graham for the reviews.
2013-11-26Fixed a typo in the documentationAlex Gaynor
2013-11-25Fixed #21507 -- Corrected default widget information for FileFieldLudwik Trammer
2013-11-23Add missing commas in Prefetch docsThomas Orozco
2013-11-23Fixed #21491 -- Removed documented workaround for a known issue.Loic Bistuer
The issue was that two M2M hidden reverse managers (related_name ending with a '+') could clash with each other. Refs #21375 and #15932. Thanks Baptiste.
2013-11-21Fixed #21479 -- Favor 'migrate' over 'syncdb' in the docs.Loic Bistuer
2013-11-21Fixed #21427 -- Clearly state integer field value ranges in docsMarkus Amalthea Magnuson
Added an explicit mention of the exact value ranges for integer type fields that are safe in all databases supported by Django. Also, put all value numbers inside double ticks.
2013-11-07Fixed #17001 -- Custom querysets for prefetch_related.Loic Bistuer
This patch introduces the Prefetch object which allows customizing prefetch operations. This enables things like filtering prefetched relations, calling select_related from a prefetched relation, or prefetching the same relation multiple times with different querysets. When a Prefetch instance specifies a to_attr argument, the result is stored in a list rather than a QuerySet. This has the fortunate consequence of being significantly faster. The preformance improvement is due to the fact that we save the costly creation of a QuerySet instance. Thanks @akaariai for the original patch and @bmispelon and @timgraham for the reviews.
2013-11-06Fixed typos in documentation.Baptiste Mispelon
2013-10-28Fixed #21344 -- Typo in docs/ref/models/queries.txtTim Graham
2013-10-23Fixed #13245: Explained Oracle's behavior w.r.t db_tableShai Berger
and how to prevent table-name truncation Thanks russellm & timo for discussion, and timo for review.
2013-10-22Fixed #17027 -- Added support for the power operator in F expressions.Florian Hahn
Thanks dan at dlo.me for the initial patch. - Added __pow__ and __rpow__ to ExpressionNode - Added oracle and mysql specific power expressions - Added used-defined power function for sqlite
2013-10-18Fixed #21212 -- Documented the reverse name for OneToOneField.Juergen Schackmann
Thanks bjb at credil.org for the report.
2013-10-15Fixed #16855 -- select_related() chains as expected.Marc Tamlyn
select_related('foo').select_related('bar') is now equivalent to select_related('foo', 'bar'). Also reworded docs to recommend select_related(*fields) over select_related()
2013-10-11Fixed #8918 -- Made FileField.upload_to optional.Tim Graham
Thanks leahculver for the suggestion and dc and vajrasky for work on the patch.
2013-10-10Whitespace cleanup.Tim Graham
* Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
2013-10-02Fixed #10913 -- Documented how related_name affects QuerySet filteringTim Graham
Thanks neithere for the suggestion.
2013-09-28Fixed #20439 -- Started deprecation of IPAddressFieldErik Romijn
2013-09-21Correct very minor typomlissner
Just changed as to has.
2013-09-13Fixed #21095 -- Documented new requirement for dates lookups.Matt Austin
Day, month, and week_day lookups now require time zone definitions in the database.
2013-09-09Fixed spelling; refs #16895.Tim Graham
Thanks Panagiotis Issaris for the report.
2013-09-09Fixed #16895 -- Warned about cost of QuerySet orderinge0ne
Thanks outofculture at gmail.com for the suggestion.
2013-09-07Fixed #20409 -- Clarified how unique_for_date works when USE_TZ is set.Aymeric Augustin
2013-09-06Merge pull request #1567 from technivore/ticket_20970Tim Graham
re-indented method documentation within RelatedManager
2013-09-06re-indented method documentation within RelatedManagerMatthew Rich
2013-09-06Merge pull request #1544 from evildmp/ticket_20920_rebaseDaniele Procida
Fixed #20920 -- Consolidated F() and Q() documentation
2013-09-06Consolidated documentation for F() and Q()evildmp
2013-09-06documented RelatedManager calling save() behind the scenes, added section on ↵Matthew Rich
direct replacement of related object set
2013-09-05Fixed #21035 -- Changed docs to treat the acronym SQL phonetically.Eric Boersma
The documentation and comments now all use 'an' to refer to the word SQL and not 'a'.
2013-08-30Fixed typo in docs/ref/models/options.txtTim Graham
2013-08-30Fixed #20988 -- Added model meta option select_on_saveAnssi Kääriäinen
The option can be used to force pre 1.6 style SELECT on save behaviour. This is needed in case the database returns zero updated rows even if there is a matching row in the DB. One such case is PostgreSQL update trigger that returns NULL. Reviewed by Tim Graham. Refs #16649
2013-08-23Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/oracle/base.py django/db/backends/postgresql_psycopg2/base.py django/db/models/signals.py tests/queries/tests.py
2013-08-22Fixed model.__eq__ and __hash__ for no pk value casesAnssi Kääriäinen
The __eq__ method now considers two instances without primary key value equal only when they have same id(). The __hash__ method raises TypeError for no primary key case. Fixed #18864, fixed #18250 Thanks to Tim Graham for docs review.
2013-08-21Documentation - Noted that OneToOneField doesn't respect unique.Kevin Christopher Henry
Added OneToOneField to the list of model fields for which the unique argument isn't valid. (OneToOneFields are inherently unique, and if the user supplies a value for unique it is ignored / overwritten.)
2013-08-21Documentation -- Corrected error about Model.full_clean()Kevin Christopher Henry
Although the ModelForm validation code was changed to call Model.full_clean(), the documentation still said otherwise. The offending phrase was removed.
2013-08-20Documentation - Noted that OneToOneField doesn't respect unique.Kevin Christopher Henry
Added OneToOneField to the list of model fields for which the unique argument isn't valid. (OneToOneFields are inherently unique, and if the user supplies a value for unique it is ignored / overwritten.)
2013-08-19Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: docs/ref/django-admin.txt
2013-08-19Removed versionadded/changed annotations for 1.5Tim Graham
2013-08-19Fixed #20777 -- Admin proxy model deletion regressionAnssi Kääriäinen
Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
2013-08-19Made Model.__eq__ consider proxy models equivalentAnssi Kääriäinen
Fixed #11892, fixed #16458, fixed #14492.