Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/db/models/query.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #25508 -- Modified QuerySet.__repr__() to ↵Tim Graham2015-10-061-1/+1
| | | | disambiguate it from a list.
* Fixed #24509 -- Added Expression support to ↵Alex Hill2015-09-221-0/+2
| | | | SQLInsertCompiler
* Fixed typos in django/db/models/query.py docstrings.Nick Pope2015-09-071-2/+2
|
* Fixed #25335 -- Fixed regression where ↵Gavin Wahl2015-09-031-14/+14
| | | | QuerySet.iterator() didn't return an iterator.
* Fixed #25252 -- Added friendly error message on ↵Y3K2015-08-311-0/+4
| | | | | | | incorrect .select_related() use Using select_related() after .values() or .values_list() is not possible because .values() or .values_list() already got the values they need.
* Fixed #12768 -- Fixed QuerySet.raw() regression on FK ↵Matt Johnson2015-07-241-3/+3
| | | | with custom db_column.
* Fixed #25081 -- Prevented DISTINCT ON ordering from ↵Simon Charette2015-07-091-1/+1
| | | | | | being cleared in get(). Thanks to pdewacht for the patch.
* Fixed #24997 -- Enabled bulk_create() on proxy modelsWilliam Schwartz2015-07-021-4/+9
|
* Fixed #23791 -- Corrected object type check for pk__in=qsAnssi Kääriäinen2015-06-291-11/+14
| | | | | | | | | | | | When the pk was a relation field, qs.filter(pk__in=qs) didn't work. In addition, fixed Restaurant.objects.filter(place=restaurant_instance), where place is an OneToOneField and the primary key of Restaurant. A big thank you to Josh for review and to Tim for review and cosmetic edits. Thanks to Beauhurst for commissioning the work on this ticket.
* Fixed #24873 -- Prevented nested Prefetch objects from ↵Gagaro2015-06-181-1/+6
| | | | being overwritten.
* Fixed #16891 -- Made Model/QuerySet.delete() return the ↵Alexander Sosnovskiy2015-05-221-2/+4
| | | | number of deleted objects.
* Removed unnecessary arguments in .get method callsPiotr Jakimiak2015-05-131-1/+1
|
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-251-2/+2
| | | | | | | | Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
* Fixed #24343 -- Ensure db converters are used for ↵Marc Tamlyn2015-02-201-3/+3
| | | | | | foreign keys. Joint effort between myself, Josh, Anssi and Shai.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-9/+12
|
* Fixed #23617 -- Added get_pk_value_on_save()Anssi Kääriäinen2015-02-031-0/+7
| | | | | | | | The method is mainly intended for use with UUIDField. For UUIDField we want to call the field's default even when primary key value is explicitly set to None to match the behavior of AutoField. Thanks to Marc Tamlyn and Tim Graham for review.
* Reverted "Fixed #6785 -- Made QuerySet.get() fetch a ↵Tim Graham2015-01-301-12/+4
| | | | | | | | limited number of rows." This reverts commit da79ccca1d34f427952cce4555e598a700adb8de. This optimized the unsuccessful case at the expense of the successful one.
* Fixed #24211 -- Removed ValuesQuerySet() and ↵Loic Bistuer2015-01-301-310/+229
| | | | | | ValuesListQuerySet(). Thanks Anssi Kääriäinen, Marc Tamlyn, and Tim Graham for the reviews.
* Fixed small inconsistency when handling aggregate's ↵Loic Bistuer2015-01-211-4/+12
| | | | | | default_alias. Refs #14030.
* Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen2015-01-081-317/+155
| | | | | | | | | | | | | | | Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
* Fixed #12663 -- Formalized the Model._meta API for ↵Daniel Pyrathon2015-01-071-11/+15
| | | | | | | retrieving fields. Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Renamed flag for detecting managers built from QuerySets ↵Markus Holtermann2015-01-051-1/+1
| | | | with as_manager().
* Fixed #21414 -- Removed RelatedObject and deprecated ↵Anssi Kääriäinen2014-12-231-2/+2
| | | | Field.related.
* Fixed #23822 -- Added support for serializing model ↵Markus Holtermann2014-12-151-1/+3
| | | | | | | managers in migration Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin, Tim Graham, Carl Meyer, and others for their review and input.
* Fixed #23968 -- Replaced list comprehension with ↵Jon Dufresne2014-12-081-2/+2
| | | | generators and dict comprehension
* Fixed #23875 -- cleaned up query.get_count()Anssi Kääriäinen2014-11-271-4/+3
|
* Fixed #23867 -- removed DateQuerySet hacksAnssi Kääriäinen2014-11-261-55/+13
| | | | | | The .dates() queries were implemented by using custom Query, QuerySet, and Compiler classes. Instead implement them by using expressions and database converters APIs.
* Fixed #14030 -- Allowed annotations to accept all ↵Josh Smeaton2014-11-151-52/+61
| | | | expressions
* Fixed #23396 -- Ensured ValueQuerySets are not checked ↵Gabe Jackson2014-10-211-0/+16
| | | | by check_related_objects.
* Fixed #23664 -- Provided a consistent definition for ↵Thomas Chaumeny2014-10-161-1/+4
| | | | | | OrderedSet.__bool__ This also defines QuerySet.__bool__ for consistency though this should not have any consequence as bool(qs) used to fallback on QuerySet.__len__ in Py3.
* Fixed #23659 -- Kept annotate() args orderingClaude Paroz2014-10-161-5/+7
| | | | Thanks Loic Bistuer and Simon Charette for the review.
* Fixed #23555 -- Avoided suppressing IndexError in ↵Artem Rizhov2014-10-081-10/+8
| | | | QuerySet.first() and .last()
* Fixed #18757, #14462, #21565 -- Reworked database-python ↵Marc Tamlyn2014-09-031-5/+4
| | | | | | | | | | | | | | type conversions Complete rework of translating data values from database Deprecation of SubfieldBase, removal of resolve_columns and convert_values in favour of a more general converter based approach and public API Field.from_db_value(). Now works seamlessly with aggregation, .values() and raw queries. Thanks to akaariai in particular for extensive advice and inspiration, also to shaib, manfre and timograham for their reviews.
* Fixed #23370 -- defer() + select_related() crashed with ↵Akis Kesoglou2014-08-301-3/+3
| | | | inherited models.
* Fixed #23313 -- Corrected repr(RawQuery) with dict ↵Andrew Torpedov2014-08-291-4/+1
| | | | parameters.
* Fixed #23001 -- Fixed mixing defer and annotationsJosh Smeaton2014-08-121-1/+1
|
* Fixed flake8 warning.Tim Graham2014-08-071-1/+1
|
* Fixed #23061: Avoided setting a limit on a query for get ↵Shai Berger2014-08-051-1/+3
| | | | | | with select_for_update on Oracle Thanks Michael Miller for reporting the issue.
* Fixed #19501 -- added Model.from_db() methodAnssi Kääriäinen2014-07-011-64/+51
| | | | | | | | | The Model.from_db() is intended to be used in cases where customization of model loading is needed. Reasons can be performance, or adding custom behavior to the model (for example "dirty field tracking" to issue automatic update_fields when saving models). A big thank you to Tim Graham for the review!
* Fixed #21430 -- Added a RuntimeWarning when unpickling ↵Anubhav Joshi2014-06-111-1/+22
| | | | | | | Models and QuerySets from a different Django version. Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch, and akaariai, loic, and charettes for helping in shaping the patch.
* Fixed several typos in DjangoAlex Gaynor2014-05-291-1/+1
|
* Fixed the ordering of prefetch lookups so that latter ↵Loic Bistuer2014-05-211-20/+16
| | | | | | lookups can refer to former lookups. Thanks Anssi Kääriäinen and Tim Graham for the reviews. Refs #17001 and #22650.
* Fixed #22650 -- Fixed regression on prefetch_related.Loic Bistuer2014-05-211-10/+7
| | | | | | | | | Regression from f51c1f59 when using select_related then prefetch_related on the reverse side of an O2O: Author.objects.select_related('bio').prefetch_related('bio__books') Thanks Aymeric Augustin for the report and tests. Refs #17001.
* Fixed #22508 -- Avoided overwriting select_related.Aymeric Augustin2014-05-101-0/+3
| | | | | | | | Previously, known related objects overwrote related objects loaded though select_related. This could cancel the effect of select_related when it was used over more than one level. Thanks boxm for the bug report and timo for bisecting the regression.
* Moved misplaced transaction.atomic from 0dce44e16bClaude Paroz2014-05-031-3/+3
| | | | | | Thanks Florian Apolloner for noticing the issue and Aymeric Augustin for the expertise. Refs #22540.
* Fixed #22540 -- Made _create_object_from_params() call ↵Claude Paroz2014-05-021-4/+3
| | | | | | | | create() So as the save step is centralized in create(), especially useful when customizing behavior in subclasses. Thanks craig.labenz@gmail.com for the report.
* Fix many many typos in comments throughout the codebaseAlex Gaynor2014-04-261-5/+5
|
* Removed legacy transaction management per the ↵Aymeric Augustin2014-03-211-3/+3
| | | | deprecation timeline.
* Fixed #22163 -- Stopped ignoring unhandled kwargs in ↵Aymeric Augustin2014-03-201-3/+1
| | | | select_for_update.
* Allowed custom querysets when prefetching single valued ↵Loic Bistuer2014-03-031-6/+7
| | | | | | | | | | | relations The original patch for custom prefetches didn't allow usage of custom queryset for single valued relations (along ForeignKey or OneToOneKey). Allowing these enables calling performance oriented queryset methods like select_related or defer/only. Thanks @akaariai and @timgraham for the reviews. Refs #17001.