Commit Graph

3785 Commits

Author SHA1 Message Date
Simon Charette 13be453080 Refs #28492 -- Stopped accessing settings at Field.db_tablespace initialization.
Deferring accesses to settings allows database fields to be initialized before
settings are loaded.
2017-09-11 12:21:49 -04:00
Jon Dufresne 99e65d6488 Fixed #28578 -- Renamed DatabaseCreation number arguments to suffix. 2017-09-11 11:32:40 -04:00
Mariusz Felisiak a4092af3d3
Removed unnecessary parens in _get_app_label_and_model_name(). 2017-09-10 21:26:06 +02:00
Tim Graham 6e4c6281db Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."
This reverts commit 550cb3a365
because try/except performs better.
2017-09-07 08:16:21 -04:00
Sergey Fedoseev 8b2515a450 Removed unneeded __init__() methods. 2017-09-07 08:10:49 -04:00
Sergey Fedoseev f3c9562143 Fixed #15648 -- Allowed QuerySet.values_list() to return a namedtuple. 2017-09-06 15:32:32 -04:00
Sergey Fedoseev 5b1c389603 Refs #23919 -- Replaced usage of django.utils.functional.curry() with functools.partial()/partialmethod(). 2017-09-06 13:11:18 -04:00
Sergey Fedoseev 34f27f910b Replaced @cached_property with class attributes where possible. 2017-09-06 10:13:43 -04:00
Sergey Fedoseev 690fc30d44 Removed DatabaseWrapper.psycopg2_version.
Unused since 3adc5f1ee6.
2017-09-06 09:51:56 -04:00
Sergey Fedoseev 379caf397e Replaced deque() with list() in prefetch_related_objects().
deque() isn't needed since algorithm doesn't require FIFO.
2017-09-06 08:13:18 -04:00
François Freitag ad4a8acdb5 Fixed #11557 -- Added support for a list of fields in Meta.get_latest_by and QuerySet.earliest()/latest(). 2017-09-05 20:14:54 -04:00
Dima Kudosh 093fd479d6 Fixed #28335 -- Allowed query expressions in Meta.ordering. 2017-09-05 19:10:20 -04:00
Mads Jensen 15f2d87ceb Removed unneeded __init__() in PostgreSQL DatabaseWrapper. 2017-09-05 16:22:36 -04:00
Boris Burkov d67cce4da8 Fixed typo in django/db/models/query.py docstring. 2017-09-05 15:28:37 -04:00
Mariusz Felisiak 179b247e07 Removed useless condition from Oracle's NullBooleanField's check constraint.
NULL cannot be compare with standard operators on Oracle, it works only
with IS NULL and IS NOT NULL operators. Therefore 'OR ... IS NULL'
condition in NullBooleanField's check constraint is redundant.
Nullability is checked in a separate constraint.
2017-09-05 11:17:06 +02:00
Jeremy Satterfield 0891503fad Fixed #28493 -- Made migrations autodetector find dependencies for model renaming. 2017-09-04 15:15:39 -04:00
Srinivas Reddy Thatiparthy 0d3f567a7a Corrected YearComparisonLookup.get_bound() signature. 2017-09-04 10:17:51 -04:00
Mariusz Felisiak fe0184b412 Updated EmpytResultSet import not to use the alias. 2017-09-03 11:06:06 -04:00
Mariusz Felisiak 2470756de0 Moved select_sql in SQLCompiler.get_extra_select() to improve performance. 2017-09-02 16:39:51 -04:00
Jeremy Kerr 84b7cb7df0 Fixed #28549 -- Fixed QuerySet.defer() with super and subclass fields.
Previously, deferring fields in different classes didn't omit the
superclass' deferred field.

Thanks Simon Charette for the suggested fix.
2017-08-31 09:35:05 -04:00
Tim Graham e5bd585c6e Fixed #28543 -- Prevented ManyToManyField.value_from_object() from being lazy.
Previously, it was a QuerySet which could reevaluate to a new value if the
model's data changes. This is inconsistent with other Field.value_from_object()
methods.

This allows reverting the fix in the admin for refs #27998.
2017-08-31 09:34:44 -04:00
Sergey Fedoseev ab3e3658cc Simplified model's Options._get_fields() a bit. 2017-08-31 07:11:30 -04:00
Sergey Fedoseev 61da949ff6 Simplified migrations.state.ProjectState.__eq__(). 2017-08-25 13:50:01 +05:00
Sergey Fedoseev a8bb493556 Simplified migrations.graph.Node.iterative_dfs(), ancestors(), and descendants(). 2017-08-23 18:10:00 -04:00
Sergey Fedoseev f2b93b509c Removed unneeded iter() calls.
A few of these were unnecessarily added in 2b281cc35e.
2017-08-23 16:48:29 -04:00
Sergey Fedoseev dca67bb2c2 Refs #28459 -- Improved performance of SQLCompiler.apply_converters(). 2017-08-23 16:26:24 -04:00
Sergey Fedoseev 9ad6071aab Simplified usage of sets in MigrationAutodetector. 2017-08-22 16:23:02 -04:00
Kevin Grinberg c6a3546093 Fixed #28451 -- Restored pre-Django 1.11 Oracle sequence/trigger naming.
Regression in 69b7d4b116.
2017-08-22 15:51:08 -04:00
Sergey Fedoseev 4dfd6b88d5 Refs #28459 -- Improved performance of FlatValuesListIterable. 2017-08-22 11:26:07 -04:00
Paulo fea9cb46aa Fixed #28375 -- Fixed KeyError crash on reverse prefetch of a model with OneToOneField primary key to a non-pk field. 2017-08-21 16:14:13 -04:00
Mariusz Felisiak c47747d45a Removed postgresql_psycopg2.version
Uneeded since 29ea9714ee.
2017-08-21 09:13:07 +02:00
Mariusz Felisiak 6784383e93 Fixed #28498 -- Fixed test database creation with cx_Oracle 6. 2017-08-16 18:39:58 +02:00
Sergey Fedoseev 41640760df Simplified generation of result in Query.get_aggregation(). 2017-08-15 09:59:31 -04:00
Sergey Fedoseev 8a99a7d2d5 Simplified RelatedPopulator.populate(). 2017-08-15 09:48:07 -04:00
Sergey Fedoseev 6542999c54 Removed redundant condition in QuerySet.resolve_expression(). 2017-08-15 09:44:27 -04:00
Sergey Fedoseev 6141040813 Avoided creation of temporary set in Query.append_annotation_mask(). 2017-08-15 09:43:47 -04:00
Tom b78d100fa6 Fixed #27849 -- Added filtering support to aggregates. 2017-08-12 17:58:28 -04:00
Mariusz Felisiak 489421b015 Fixed #23546 -- Added kwargs support for CursorWrapper.callproc() on Oracle.
Thanks Shai Berger, Tim Graham and Aymeric Augustin for reviews and
Renbi Yu for the initial patch.
2017-08-12 21:06:49 +02:00
Sergey Fedoseev 47ccefeada Refs #28459 -- Improved performance of BaseExpression.convert_value(). 2017-08-11 18:34:50 -04:00
Sergey Fedoseev 5cc7462067 Refs #28459 -- Optimized ModelState instantiation. 2017-08-11 15:41:04 -04:00
Nerl~ 97cb3bd16d Fixed #28456 -- Allowed customizing Model pickling by overriding __getstate__(). 2017-08-11 15:27:25 -04:00
Sergey Fedoseev 0ec134e340 Simplified calculation of used joins in Query.build_filter(). 2017-08-11 10:46:11 -04:00
Sergey Fedoseev 9ecf280394 Removed obsolete DecimalComparisonLookup.
Unneeded since c3c6c92d76.
2017-08-11 09:32:32 -04:00
Sergey Fedoseev f3e350d631 Replaced typecast_decimal() with decimal.Decimal(). 2017-08-11 09:22:40 -04:00
Sergey Fedoseev 7fa92daa99 Removed outdated comment in Query.build_filter(). 2017-08-11 09:19:19 -04:00
Evan Grim 7937cc16f5 Fixed #28386 -- Made operations within non-atomic migrations honor the operation's atomic flag when migrating backwards. 2017-08-10 19:21:14 -04:00
Sergey Fedoseev c3c6c92d76 Refs #18247 -- Fixed filtering on CombinedExpression(output_field=DecimalField()) annotation on SQLite. 2017-08-10 17:42:30 -04:00
Sergey Fedoseev a146b65628 Refs #28459 -- Improved performance of loading DecimalField on SQLite. 2017-08-10 15:32:28 -04:00
Paulo bfb746f983 Refs #16043 -- Refactored internal fields value cache.
* Removed all hardcoded logic for _{fieldname}_cache.
* Added an internal API for interacting with the field values cache.

Thanks carljm and MarkusH for support.
2017-08-10 12:06:02 -04:00
Sergey Fedoseev 22ff86ec52 Refs #28459 -- Made Oracle get_db_converters() return converter for empty strings only when it's needed. 2017-08-10 10:33:05 -04:00