summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2013-02-05Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette
2013-02-04Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz
Thanks Carl Meyer for the report.
2013-02-04Fixed #19653 -- Removed `Manager.get_empty_query_set`.Simon Charette
2013-01-31Fixed #19709 -- Fixed TimeField introspection on MySQLClaude Paroz
Thanks Eugene Grachev for the report.
2013-01-29Fixed typos in docs and commentsTim Graham
2013-01-28Fixed #19677 -- Introspection of recursive foreign keys under SQLite.Aymeric Augustin
Thanks Simon Charette.
2013-01-26Fixed #17158 -- Used a non-ambiguous representation of SQL queriesAymeric Augustin
when a correct representation cannot be obtained.
2013-01-23Remove dup_select_related method.Marc Tamlyn
This undocumented method was used in an old version of the admin, is totally untested and hails from 2008. Although it's listed in the "public methods" section, as it's not documented or used I don't think it needs a deprecation path. If we think it's useful I'll write some tests/docs for it instead...
2013-01-20Fixed #17813 -- Added a .earliest() method to QuerySetNick Sandford
Thanks a lot to everybody participating in developing this feature. The patch was developed by multiple people, at least Trac aliases tonnzor, jimmysong, Fandekasp and slurms. Stylistic changes added by committer.
2013-01-19Fixed #19606 -- Adjusted cx_Oracle unicode detection.Jani Tiainen
2013-01-18Removed models/related.py BoundRelatedObjectAnssi Kääriäinen
The class wasn't used anywhere except in RelatedObject.bind(), which wasn't used anywhere. The class had one method defined as NotImplemented, yet the class wasn't subclassed anywhere. In short, the class was dead code.
2013-01-18Avoided unnecessary recreation of RelatedObjectsAnssi Kääriäinen
Refs #19399. Thanks to Track alias KJ for the patch.
2013-01-14Move logic seperation as its not longer repetitiveDavid Cramer
2013-01-14Send post_delete signals immediatelyDavid Cramer
In a normal relational construct, if you're listening for an event that signals a child was deleted, you dont expect that the parent was deleted already. This change ensures that post_delete signals are fired immediately after objects are deleted in the graph.
2013-01-12Fixed #17574 -- Implemented missing get_key_columns in PostgreSQL backendClaude Paroz
2013-01-12Return namedtuple from get_table_descriptionClaude Paroz
We don't make use of it currently to not break third-party db backends.
2013-01-11Removed some now dead code from deletion (thanks to Carl Meyer for noticing it).Alex Gaynor
2013-01-11Fixed #19360 -- Raised an explicit exception for aggregates on date/time ↵Nick Sandford
fields in sqlite3 Thanks lsaffre for the report and Chris Medrela for the initial patch.
2013-01-08Fixed #19576 -- Use `six.with_metaclass` uniformously accross code base.Simon Charette
2013-01-08Fixed #17541 -- Fixed non-saved/nullable fk queryingAnssi Kääriäinen
2013-01-08Fixed #16759 -- Remove use of __deepcopy__ in qs.clone()Anssi Kääriäinen
The original problem was that queryset cloning was really expensive when filtering with F() clauses. The __deepcopy__ went too deep copying _meta attributes of the models used. To fix this the use of __deepcopy__ in qs cloning was removed. This commit results in some speed improvements across the djangobench benchmark suite. Most query_* tests are 20-30% faster, save() is 50% faster and finally complex filtering situations can see 2x to order of magnitude improvments. Thanks to Suor, Alex and lrekucki for valuable feedback.
2013-01-07Created special PostgreSQL text indexes when unique is TrueClaude Paroz
Refs #19441.
2013-01-06Fixed #19173 -- Made EmptyQuerySet a marker class onlyAnssi Kääriäinen
The guarantee that no queries will be made when accessing results is done by new EmptyWhere class which is used for query.where and having. Thanks to Simon Charette for reviewing and valuable suggestions.
2013-01-04Fixed #19192 -- Allowed running tests with dummy db backendClaude Paroz
Thanks Simon Charette for the initial patch, and Jan Bednařík for his work on the ticket.
2013-01-03Added documentation for the 'db' argument of the post-syncdb signal.mpaolini
2013-01-02Fixed PR 478 -- Removed superfluous try/except block.Aymeric Augustin
2013-01-02Fixed #19547 -- Caching of related instances.Aymeric Augustin
When &'ing or |'ing querysets, wrong values could be cached, and crashes could happen. Thanks Marc Tamlyn for figuring out the problem and writing the patch.
2012-12-30Minor improvement to proxy model handlingAnssi Kääriäinen
Refs #19385
2012-12-30Made use of PathInfo.direct flag in trim_joinsAnssi Kääriäinen
Refs #19385
2012-12-30Added Query.join_parent_model()Anssi Kääriäinen
This simplifies especially compiler.py a lot, where almost the same code was repeated multiple times. Refs #19385
2012-12-30Moved join path generation to FieldAnssi Kääriäinen
Refs #19385
2012-12-30Made sure join_field is always available in .join()Anssi Kääriäinen
Refs #19385
2012-12-29Advanced pending deprecation warnings.Aymeric Augustin
Also added stacklevel argument, fixed #18127.
2012-12-28Fix #19524 -- Incorrect caching of parents of unsaved model instances.Aymeric Augustin
Thanks qcwxezdas for the report. Refs #13839.
2012-12-27Fixed #19525 -- Reverted dcd4383107 and 05d333ba3b.Aymeric Augustin
Refs #9893, #18515. Thanks Russell for the report.
2012-12-20Fixed a regression in distinct_onAnssi Kääriäinen
Caused by regression fix for #19500.
2012-12-20Fixed #18854 -- Join promotion in disjunction casesAnssi Kääriäinen
The added promotion logic is based on promoting any joins used in only some of the childs of an OR clause unless the join existed before the OR clause addition.
2012-12-20Fixed #19500 -- Solved a regression in join reuseAnssi Kääriäinen
The ORM didn't reuse joins for direct foreign key traversals when using chained filters. For example: qs.filter(fk__somefield=1).filter(fk__somefield=2)) produced two joins. As a bonus, reverse onetoone filters can now reuse joins correctly The regression was caused by the join() method refactor in commit 68847135bc9acb2c51c2d36797d0a85395f0cd35 Thanks for Simon Charette for spotting some issues with the first draft of the patch.
2012-12-20Fixed #19401 -- Ensure that swappable model references are case insensitive.Russell Keith-Magee
This is necessary because get_model() checks are case insensitive, and if the swapable check isn't, the swappable logic gets tied up in knots with models that are partially swapped out. Thanks to chris@cogdon.org for the report and extensive analysis, and Preston for his work on the draft patch.
2012-12-18Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/models/loading.py django/db/models/options.py
2012-12-18Fixed #19441 -- Created PostgreSQL varchar index when unique=TrueClaude Paroz
Thanks Dylan Verheul for the report and Anssi Kääriäinen for the review.
2012-12-17Replaced '__' with LOOKUP_SEP in sql/query.pyAnssi Kääriäinen
Thanks to Simon Charette for report.
2012-12-16Fixed #19197 -- fixed convert_values() for nullable numeric fieldsAnssi Kääriäinen
Cleaned up the implementation of base convert_values() a little, and made sure it accepts None as a value for numeric fields. There are no tests attached. The reason is that not all of the convert_values() accept None as a value for numeric fields (for example sqlite3.convert_values()). The reason the base convert_values() needs to accept None is that this situation might arise in custom compilers for 3rd party backends. It is easy to keep the convert_values() working, so lets do that.
2012-12-16Fixed #16679 -- Use caching to speed up signal sendingAnssi Kääriäinen
2012-12-16Fixed #10790 -- Refactored sql.Query.setup_joins()Anssi Kääriäinen
This is a rather large refactoring. The "lookup traversal" code was splitted out from the setup_joins. There is now names_to_path() method which does the lookup traveling, the actual work of setup_joins() is calling names_to_path() and then adding the joins found into the query. As a side effect it was possible to remove the "process_extra" functionality used by genric relations. This never worked for left joins. Now the extra restriction is appended directly to the join condition instead of the where clause. To generate the extra condition we need to have the join field available in the compiler. This has the side-effect that we need more ugly code in Query.__getstate__ and __setstate__ as Field objects aren't pickleable. The join trimming code got a big change - now we trim all direct joins and never trim reverse joins. This also fixes the problem in #10790 which was join trimming in null filter cases.
2012-12-16Fixed #18816 -- Removed "trim" argument from add_filter()Anssi Kääriäinen
The trim argument was used by split_exclude() only to trim the last join from the given lookup. It is cleaner to just trim the last part from the lookup in split_exclude() directly so that there is no need to burden add_filter() with the logic needed for only split_exclude().
2012-12-16Fixed #19469 -- Removed opts.get_ordered_objects() and related codeAnssi Kääriäinen
The code was dead-code since 2006.
2012-12-14Fixed #2304 -- Documented TRANSACTIONS_MANAGED.Aymeric Augustin
2012-12-08Fixed #19357 -- Allow non-ASCII chars in filesystem pathsClaude Paroz
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-12-01Typeo in ValuesQuerySet._as_sql docstringorblivion