summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2013-05-20Fixed #20278 -- ensured .get() exceptions do not recurse infinitelyAnssi Kääriäinen
A regression caused by d5b93d3281fe93cbef5de84a52 made .get() error reporting recurse infinitely on certain rare conditions. Fixed this by not trying to print the given lookup kwargs.
2013-05-20Fixed #20378 -- regression in GenericRelation on abstract modelAnssi Kääriäinen
When a GenericRelation was defined on abstract model, queries on childs of the abstract model didn't work. The problem was in the way fields and in particular field.rel was copied from models to their children. The regression was likely caused by #19385. Thanks to Gavin Wahl for spotting the regression.
2013-05-20Fixed qs.values() regression when used in subqueryAnssi Kääriäinen
2013-05-19Fixed #11442 -- Postgresql backend casts all inet types to textErik Romijn
2013-05-19ModelState now freezes options and basesAndrew Godwin
2013-05-18Add a deconstruct() method to Fields.Andrew Godwin
This allows the field's initial argument to be obtained so it can be serialised to, and re-created from, a textual format.
2013-05-18Merge branch 'master' into schema-alterationAndrew Godwin
2013-05-17Replaced an antiquated pattern.Aymeric Augustin
Thanks Lennart Regebro for pointing it out.
2013-05-15Fixed #20413 - Respect Query.get_meta()Mike Fogel
2013-05-10Merge branch 'master' into schema-alterationAndrew Godwin
2013-05-09Rest of the _meta.app_cache stuff. Schema tests work now.Andrew Godwin
2013-05-09Split out a BaseAppCache, make AppCache borg again, add _meta.app_cacheAndrew Godwin
2013-05-09Whoops. Need to be good and use six.Andrew Godwin
2013-05-09Improve error message for bad FK resolutionAndrew Godwin
2013-05-08Merge pull request #1049 from mfogel/remove-unescessary-parameter-checksAlex Gaynor
Remove unnecessary check on __set__ parameters.
2013-05-08Fixed test failures on MySQL.Aymeric Augustin
Some tests failed when the time zone definitions were loaded in MySQL and pytz wasn't installed. This setup isn't supported.
2013-05-07Remove unnecessary check on __set__ parameters.Mike Fogel
2013-05-04Systematically imported wraps from functoolsClaude Paroz
2013-04-25Converted a list comprehension into a generator expression in query_utils.pyAdrian Holovaty
2013-04-25Negligible formatting fixes in query_utils.pyAdrian Holovaty
2013-04-25Removed an errant ipdb import from commit 9777442Adrian Holovaty
2013-04-18Merge branch 'master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/__init__.py django/db/backends/mysql/base.py django/db/backends/oracle/base.py django/db/backends/oracle/creation.py django/db/backends/postgresql_psycopg2/base.py django/db/backends/sqlite3/base.py django/db/models/fields/related.py
2013-04-18Use `LOOKUP_SEP` in `get_or_create`.Simon Charette
2013-04-08Fixed #14019 -- Initialize `SQLInsertCompiler.return_id` attribute.Tobias McNulty
2013-04-05Fixed #20207 -- Handle ManyToManyField with a unicode name correctly.Simon Charette
2013-04-04Fixed a line that was overindented.Alex Gaynor
2013-04-01Fixed deprecation warnings introduced by ↵Simon Charette
97774429aeb54df4c09895c07cd1b09e70201f7d.
2013-03-28Fixed spelling errorsGavin Wahl
2013-03-26Fixed #20091 -- Oracle null promotion for empty stringsAnssi Kääriäinen
2013-03-24Fixed Oracle specific failures in multicolumn joinsAnssi Kääriäinen
Refs #19385
2013-03-24Fixed field.rel.field_name handlingAnssi Kääriäinen
This is a regression fix to multicolumn joins. Refs #19385.
2013-03-24Python 2.6 compatibility for #19385Anssi Kääriäinen
2013-03-24Fixed #19385 again, now with real code changesAnssi Kääriäinen
The commit of 266de5f9ae9e9f2fbfaec3b7e4b5fb9941967801 included only tests, this time also code changes included...
2013-03-24Fixed #15124 -- Changed the default for BooleanField.Aymeric Augustin
Thanks to the many contributors who updated and improved the patch over the life of this ticket.
2013-03-22Fixed #20094 - Be more careful when checking for IteratorMarc Tamlyn
Python 2.6 has some different behaviour when checking isinstance(foo, collections.Iterator).
2013-03-21Removed unused importAnssi Kääriäinen
2013-03-20Revert "Fixed 19895 -- Made second iteration over invalid queryset raise an ↵Claude Paroz
exception too" This reverts commit 2cd0edaa477b327024e4007c8eaf46646dcd0f21. This commit was the cause of a memory leak. See ticket for more details. Thanks Anssi Kääriäinen for identifying the source of the bug.
2013-03-17Fixed #19635 -- Made fields pickleableAnssi Kääriäinen
2013-03-17Merge pull request #902 from evildmp/BLANK_CHOICE_NONEAymeric Augustin
Fixed #20043 -- Removed unused BLANK_CHOICE_NONE
2013-03-14Fixed #16649 -- Refactored save_base logicAnssi Kääriäinen
Model.save() will use UPDATE - if not updated - INSERT instead of SELECT - if found UPDATE else INSERT. This should save a query when updating, but will cost a little when inserting model with PK set. Also fixed #17341 -- made sure .save() commits transactions only after the whole model has been saved. This wasn't the case in model inheritance situations. The save_base implementation was refactored into multiple methods. A typical chain for inherited save is: save_base() _save_parents(self) for each parent: _save_parents(parent) _save_table(parent) _save_table(self)
2013-03-13removed unused BLANK_CHOICE_NONEDaniele Procida
2013-03-13Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen
The sql/query.py add_q method did a lot of where/having tree hacking to get complex queries to work correctly. The logic was refactored so that it should be simpler to understand. The new logic should also produce leaner WHERE conditions. The changes cascade somewhat, as some other parts of Django (like add_filter() and WhereNode) expect boolean trees in certain format or they fail to work. So to fix the add_q() one must fix utils/tree.py, some things in add_filter(), WhereNode and so on. This commit also fixed add_filter to see negate clauses up the path. A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to .filter(~Q(reversefk__in=a_list)). The reason for this is that only the immediate parent negate clauses were seen by add_filter, and thus a tree like AND: (NOT AND: (AND: condition)) will not be handled correctly, as there is one intermediary AND node in the tree. The example tree is generated by .exclude(~Q(reversefk__in=a_list)). Still, aggregation lost connectors in OR cases, and F() objects and aggregates in same filter clause caused GROUP BY problems on some databases. Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-12Fixed #19964 -- Removed relabel_aliases from some structsAnssi Kääriäinen
Before there was need to have both .relabel_aliases() and .clone() for many structs. Now there is only relabeled_clone() for those structs where alias is the only mutable attribute.
2013-03-11Used commit_on_success_unless_managed to make ORM operations atomic.Aymeric Augustin
2013-03-11Deprecated transaction.is_managed().Aymeric Augustin
It's synchronized with the autocommit flag.
2013-03-11Deprecated transaction.commit/rollback_unless_managed.Aymeric Augustin
Since "unless managed" now means "if database-level autocommit", committing or rolling back doesn't have any effect. Restored transactional integrity in a few places that relied on automatically-started transactions with a transitory API.
2013-03-11Made transaction.managed a no-op and deprecated it.Aymeric Augustin
enter_transaction_management() was nearly always followed by managed(). In three places it wasn't, but they will all be refactored eventually. The "forced" keyword argument avoids introducing behavior changes until then. This is mostly backwards-compatible, except, of course, for managed itself. There's a minor difference in _enter_transaction_management: the top self.transaction_state now contains the new 'managed' state rather than the previous one. Django doesn't access self.transaction_state in _enter_transaction_management.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-03-07Added a ManyToManyField(db_constraint=False) option, this allows not ↵Alex Gaynor
creating constraints on the intermediary models.
2013-03-06One more EMPTY_VALUES replacement following 22be90dd17Claude Paroz
Thanks Loic Bistuer for catching this omission. Refs #19989.