Commit Graph

1951 Commits

Author SHA1 Message Date
Adam Chainz 74742aa956 Fixed #27512 -- Removed unused code in Model.__init__(). 2016-11-20 19:39:32 -05:00
Adam Chainz 9d4246419c Refs #26207 -- Removed obsolete comments about deferred model classes. 2016-11-20 18:22:13 -05:00
Adam Chainz cc1f6f26b6 Fixed #27514 -- Tested Model.__init__ excessive number of fields. 2016-11-20 13:21:59 -05:00
Simon Charette 31a56e30cf Fixed #27407 -- Made Model.delete(keep_parents=True) preserve parent reverse relationships.
Thanks Tim for the review.
2016-11-15 20:16:06 -05:00
Ramin Farajpour Cami 967be82443 Fixed E305 flake8 warnings. 2016-11-14 12:30:46 -05:00
Mads Jensen 1446902be4 Fixed #25240 -- Added ExtractWeek and exposed it through the __week lookup.
Thanks to Mariusz Felisiak and Tim Graham for review.
2016-11-11 08:01:40 -05:00
Tim Graham ac0cf97cb4 Removed redundant DateTimeField.register_lookup()s.
DateTimeField inherits these lookups from DateField.
2016-11-10 10:15:56 -05:00
Tim Graham 2f9861d823 Fixed #27148 -- Fixed ModelMultipleChoiceField crash with invalid UUID. 2016-10-31 15:21:05 -04:00
Michael Scott ec9ed07488 Fixed #27188 -- Allowed using unique=True with FileField.
Thanks Tim Graham for the initial patch.
2016-10-28 20:11:03 -04:00
Tim Graham 1bc249c2a6 Fixed #20939 -- Simplified query generation by converting QuerySet to Query.
Thanks Anssi Kääriäinen for the initial patch and Anssi, Simon Charette,
and Josh Smeaton for review.
2016-10-28 11:20:23 -04:00
Tim Graham 414ad25b09 Fixed #27327 -- Simplified time zone handling by requiring pytz. 2016-10-27 08:53:20 -04:00
Adam Chidlow f734e2d4b2 Fixed #27334 -- Allowed FileField to move rather than copy a file.
When a FileField is set to an instance of File that is not also an
instance of FieldFile, pre_save() passes that object as the contents to
Storage.save(). This allows the file to be moved rather than copied
to the upload destination.
2016-10-26 12:25:30 -04:00
David Barragán Merino b3bd3aa07c Fixed #27385 -- Fixed QuerySet.bulk_create() on PostgreSQL when the number of objects is a multiple plus one of batch_size. 2016-10-25 19:21:08 -04:00
Tim Graham 19f1321fa4 Removed unused loop in Query.change_aliases().
Unknown if it was ever used.
2016-10-24 11:27:41 -04:00
Tim Graham 50864b402b Removed unused branch in ModelIterable.__iter__().
Unknown if it was ever used.
2016-10-15 10:19:47 -04:00
Tim Graham 5d1941adcf Removed unused 'field' argument to DeleteQuery.delete_batch().
Unused since a170c3f755.
2016-10-15 10:19:02 -04:00
Tim Graham 274b227796 Removed DatabaseFeatures.can_combine_inserts_with_and_without_auto_increment_pk.
Unused (always False) after 29132ebdef.
2016-10-14 17:18:28 -04:00
Tim Graham 8997750c43 Removed unused QuerySet.value_annotation attribute.
Unused since 5008a4db44.
2016-10-14 16:46:37 -04:00
Tim Graham b679a3cdb1 Tested QuerySet compatibility check.
cdfdcf4b70 missed this test.
2016-10-14 08:51:04 -04:00
Tim Graham f2dc6b3a99 Removed unused InsertQuery.clone().
Unknown if it was ever needed.
2016-10-13 16:58:43 -04:00
Tim Graham 3b2db6ec12 Removed unneeded try/except in Query.names_to_path(). 2016-10-13 16:56:54 -04:00
Tim Graham df1796b13f Removed unused branch in SQLUpdateCompiler.as_sql().
Unknown if it was ever needed.
2016-10-13 16:56:26 -04:00
Tim Graham 419de7b00d Removed unused branch in Query.change_aliases().
Unused since 0c7633178f.
2016-10-13 14:35:10 -04:00
Tim Graham 816eae3508 Removed unused EmptyResultSets in SQLCompilers.
Unused since ed1bcf0515.
2016-10-13 12:12:58 -04:00
João Sampaio 74a575eb72 Fixed #24607 -- Serialized natural keys in multi-table inheritance models. 2016-10-12 20:04:57 -04:00
Tim Graham a3a10f8abe Removed unused SubqueryConstraint.relabel_aliases() and clone() methods.
Unused since b68212f539.
2016-10-12 08:18:56 -04:00
Nick Pope f1664a2734 Replaced '__' with LOOKUP_SEP constant. 2016-10-11 11:14:06 -04:00
Tim Graham 46a3d7604e Fixed gis_tests.geoapp when run in isolation.
"from django.db.models import *" in contrib/gis/db/models/__init__.py could
obscure gis's functions.py resulting in exceptions like:
"module 'django.db.models.functions' has no attribute 'Union'".
2016-10-10 10:13:01 -04:00
Tim Graham 0083a4c8e9 Refs #18974 -- Deprecated @models.permalink() decorator. 2016-10-04 14:39:49 -04:00
François Freitag 8ac115c730 Fixed #27193 -- Preserved ordering in select_for_update subqueries. 2016-10-04 10:46:29 -04:00
François Freitag 1db1f74617 Refs #27118 -- Reallowed using pk in QuerySet.get/update_or_create(). 2016-10-04 10:10:39 -04:00
Mariusz Felisiak 14986a0b9d Fixed #27268 -- Restored an invalid related field lookup error message in QuerySet filtering. 2016-09-27 15:00:36 -04:00
Tim Graham 419b6ec7d0 Removed unused branch in SQLCompiler.as_subquery_condition().
Unused since dcdc579d16.
2016-09-27 09:58:53 -04:00
Tim Graham c47f8a9d4d Removed obsolete lines in DeferredAttribute.__get__().
Obsolete as of c21e86ab9e.
2016-09-26 18:47:07 -04:00
François Freitag a5e13a0b92 Fixed #27118 -- Made QuerySet.get_or_create()/update_or_create() error for a non-field in their arguments. 2016-09-24 20:16:16 -04:00
Tim Graham 5d55a26019 Removed unused FieldGetDbPrepValueMixin.get_prep_lookup_value().
Unused since its introduction in 4f138fe5a4.
2016-09-24 17:30:43 -04:00
Tim Graham f4bde7d9a1 Removed unused Prefetch.get_current_prefetch_through().
Unused since its introduction in f51c1f5900.
2016-09-23 17:11:15 -04:00
Jani Tiainen 7a2c27112d Fixed #27159 -- Prevented pickling a query with an __in=inner_qs lookup from evaluating inner_qs. 2016-09-22 19:59:11 -04:00
François Freitag 631ef6b272 Made FieldError/FieldDoesNotExist messages uniform across Python versions.
Removed possible u'' prefixes on Python 2.
2016-09-17 09:29:14 -04:00
Chris Lamb 9027e6c8a3 Fixed #27235 -- Removed some usage of mutable default arguments. 2016-09-16 15:48:08 -04:00
Tim Graham e7abb5ba86 Fixed #27204 -- Made clashing m2m intermediary table checks ignore unmanaged models. 2016-09-09 19:18:37 -04:00
Mikhail Denisenko bae64dd0f1 Fixed #27062 -- Eased implementing select_for_update() on MSSQL. 2016-09-09 11:57:38 -04:00
Simon Charette 0bbab97c28 Refs #15250 -- Removed an obsolete comment regarding MTI cascade deletion. 2016-09-08 00:20:54 -04:00
Claude Paroz 2ced2f785d Replaced smart_* by force_* calls whenever possible
The smart_* version should only be used when a lazy string should keep
its lazy status.
2016-09-03 13:46:41 +02:00
Berker Peksag a02b5848ae Replaced property() usage with decorator in several places. 2016-08-25 20:06:22 -04:00
Claude Paroz 066283a11d Removed unneeded smart_text 2016-08-25 22:49:31 +02:00
Mattias Loverot 2315114090 Fixed #27067 -- Deprecated string_concat() in favor of format_lazy(). 2016-08-25 16:12:40 -04:00
Berker Peksag 3c97ba2a0d Replaced property() usage with decorator in a couple places. 2016-08-24 17:23:16 -04:00
Matthew Wilkes 4f138fe5a4 Fixed #22288 -- Fixed F() expressions with the __range lookup. 2016-08-19 13:40:56 -04:00
Ian Foote 39f35d4b9d Fixed #25871 -- Added expressions support to QuerySet.values(). 2016-08-18 16:05:15 -04:00