1
0
mirror of https://github.com/django/django.git synced 2025-03-28 18:20:49 +00:00

2271 Commits

Author SHA1 Message Date
Peter Inglesby
a4cac17200 Fixed -- Fixed filtering on annotated DecimalField on SQLite. 2016-12-24 10:38:48 -05:00
Adam Chainz
8d94d575f8 Used @cached_property in RawQuerySet. 2016-12-23 10:12:48 -05:00
Adam Chainz
6ebf8f9057 Refs -- Made QuerySet._prefetch_related_lookups immutable. 2016-12-23 09:58:22 -05:00
Andrey Kuzminov
b8741c0058 Refs -- Corrected field name in an m2m manager error message. 2016-12-23 09:31:26 -05:00
Tim Graham
09a7f121b5 Removed unneeded values in NullBooleanField.formfield().
These values are duplicated in the super().
2016-12-20 07:54:54 -05:00
Adam Chainz
d2a26c1a90 Optimized Model instantiation a bit.
* Avoid some unnecessary attribute lookups, e.g. access signals directly rather than from module
* Alias some repeat accesses inside the method to use the slightly faster local lookups
* Use tuple to iterate remaining kwargs as it's faster to construct
* Cache Field.get_default() to avoid running through all the logic on every call
* Use a cached list of the properties on the model class to avoid repeat isinstance() calls
2016-12-15 13:42:44 -05:00
Morgan Aubert
ef889d5b10 Fixed -- Fixed Field.__str__() crash for fields not attached to models. 2016-12-14 14:04:26 -05:00
Daniel Hillier
7da37699e8 Fixed -- Fixed select_related() with reverse self-referential OneToOneField.
Fixed definition of `klass_info['from_parent']` so that two models aren't
considered from a parent class if the model classes are the same.
2016-12-14 07:46:27 -05:00
Yohann Gabory
47ef8f31f3 Fixed -- Allowed specifying the order of null fields in queries.
Thanks Mariusz Felisiak for finishing the patch.
2016-12-08 09:54:07 -05:00
InvalidInterrupt
98359109eb Fixed -- Allowed using a ManyToManyField through model that inherits another. 2016-12-07 17:50:51 -05:00
Sergey Fedoseev
f909fa84be Fixed -- Fixed annotations with geometry values. 2016-12-07 14:16:29 -05:00
Tim Graham
dd99e69fa8 Refs -- Fixed Python 3.6 deprecation warning for empty model super() calls.
https://bugs.python.org/issue23722

Thanks Nick Coghlan for advice and review.
2016-12-05 19:37:23 -05:00
Keda87
48826aa541 Fixed -- Removed hardcoded class names in __repr__() methods. 2016-12-01 08:11:09 -05:00
Lex Berezhny
1a9bd75bfa Refs -- Fixed system check crash with an empty FileField.upload_to. 2016-11-30 10:07:42 -05:00
Henry Dang
7cddd8a02e Fixed -- Added a system check to prevent FileField's upload_to from starting with a slash.
Thanks Frank Bijlsma for the initial patch.
2016-11-29 16:12:24 -05:00
Adam Chainz
6252fd6314 Fixed -- Deprecated Model._meta.has_auto_field 2016-11-25 13:24:11 -05:00
Adam Chainz
92bbef8b9e Improved the way Model.save() skips the auto_field.
Identity comparison is quicker than isinstance(), and it avoids coupling
between Model and AutoField.
2016-11-24 06:01:36 -05:00
Adam Chainz
e044026dce Fixed -- Made Prefetches pickle without evaluating their QuerySet. 2016-11-23 11:23:14 -05:00
Tim Graham
2e5fbe889f Cleaned up some __getstate__() docstrings. 2016-11-23 09:45:21 -05:00
Quentin Fulsher
f62abfc03d Fixed -- Added a system check to prohibit model names that start or end with an underscore or contain double underscores. 2016-11-22 10:14:10 -05:00
Adam Chainz
74742aa956 Fixed -- Removed unused code in Model.__init__(). 2016-11-20 19:39:32 -05:00
Adam Chainz
9d4246419c Refs -- Removed obsolete comments about deferred model classes. 2016-11-20 18:22:13 -05:00
Adam Chainz
cc1f6f26b6 Fixed -- Tested Model.__init__ excessive number of fields. 2016-11-20 13:21:59 -05:00
Simon Charette
31a56e30cf Fixed -- 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 -- 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 -- Fixed ModelMultipleChoiceField crash with invalid UUID. 2016-10-31 15:21:05 -04:00
Michael Scott
ec9ed07488 Fixed -- 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 -- 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 -- Simplified time zone handling by requiring pytz. 2016-10-27 08:53:20 -04:00
Adam Chidlow
f734e2d4b2 Fixed -- 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 -- 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 a170c3f755351beb35f8166ec3c7e9d524d9602d.
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 29132ebdef0e0b9c09e456b05f0e6a22f1106a4f.
2016-10-14 17:18:28 -04:00
Tim Graham
8997750c43 Removed unused QuerySet.value_annotation attribute.
Unused since 5008a4db440c8f7d108a6979b959025ffb5789ba.
2016-10-14 16:46:37 -04:00
Tim Graham
b679a3cdb1 Tested QuerySet compatibility check.
cdfdcf4b70bebfc68871df885387790c6afbc23c 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 0c7633178fa9410f102e4708cef979b873bccb76.
2016-10-13 14:35:10 -04:00
Tim Graham
816eae3508 Removed unused EmptyResultSets in SQLCompilers.
Unused since ed1bcf05158acf4bf4e0189d477b6c762bd0133e.
2016-10-13 12:12:58 -04:00
João Sampaio
74a575eb72 Fixed -- 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 b68212f539f206679580afbfd008e7d329c9cd31.
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 -- Deprecated @models.permalink() decorator. 2016-10-04 14:39:49 -04:00
François Freitag
8ac115c730 Fixed -- Preserved ordering in select_for_update subqueries. 2016-10-04 10:46:29 -04:00