summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2013-07-22Merge branch 'master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/mysql/introspection.py django/db/backends/oracle/creation.py django/db/backends/postgresql_psycopg2/creation.py django/db/models/base.py django/db/models/loading.py
2013-07-16Fixed #14007 -- Added model discovery in models module without the need to ↵Tim Graham
specify app_label. Thanks mark@ and Aramgutang for work on the patch.
2013-07-14Fixed #20746 -- Removed Python 2.6 specific code/docsTim Graham
2013-07-12Fixed #20740 -- GenericIPAddressField should pass protocol to formfield()Tim Graham
Thanks Jeff250.
2013-07-12Fixed #20429 -- Added QuerySet.update_or_createKarol Sikora
Thanks tunixman for the suggestion and Loic Bistuer for the review.
2013-07-09Fixed #17339 -- Factor out has_result into database backend.Tim Graham
Thanks jonash.
2013-07-08Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows.Tim Graham
Thanks Patryk Zawadzki.
2013-07-08A large number of stylistic cleanups across django/db/Alex Gaynor
2013-07-08Removed some logic that wasn't needed following removal of some deprecated code.Alex Gaynor
2013-07-02Merge branch 'master' into schema-alterationAndrew Godwin
2013-07-01Removed some conditional code only needed under Python 2.6.Aymeric Augustin
2013-06-30Removed a comment that wasn't adding a value.Alex Gaynor
In the intervening years, RelatedField has become less of a hack (though it still is one). Anyone who wants to can re-instate the comment, but please add more details.
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-06-29Fixed #20660 -- Do not try to delete an unset FieldFileClaude Paroz
Thanks stanislas.guerra at gmail.com for the report and Baptiste Mispelon for the review.
2013-06-28Removed 'depth' .select_related() argument as per deprecation TL.Ramiro Morales
2013-06-28Fix Python 3 supportAndrew Godwin
2013-06-28Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py tests/field_deconstruction/tests.py
2013-06-28Ported over Field.deconstruct() from my schema alteration branch.Andrew Godwin
This is to help other ongoing branches which would benefit from this functionality.
2013-06-28Support 'pyformat' style parameters in raw queries, Refs #10070Shai Berger
Add support for Oracle, fix an issue with the repr of RawQuerySet, add tests and documentations. Also added a 'supports_paramstyle_pyformat' database feature, True by default, False for SQLite. Thanks Donald Stufft for review of documentation.
2013-06-27Add related_query_name to ForeignKey/M2M. Refs #20244Andrew Godwin
2013-06-25Fixed #20642 -- Deprecated `Option.get_(add|change|delete)_permission`.Simon Charette
Those methods were only used by `contrib.admin` internally and exclusively related to `contrib.auth`. Since they were undocumented but used in the wild the raised deprecation warning point to an also undocumented alternative that lives in `contrib.auth`. Also did some PEP8 and other cleanups in the affected modules.
2013-06-22Remove EmailField max_length default removal in deconstruct()Andrew Godwin
2013-06-19Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/models/loading.py
2013-06-18Fixed #14930 -- values_list() failure on qs ordered by extra columnFlorian Hahn
Thanks lsaffre for the report and simon29, vicould, and Florian Hahn for the patch. Some changes done by committer.
2013-06-18Fixed #20199 -- Allow ModelForm fields to override error_messages from model ↵Loic Bistuer
fields
2013-06-18Refactored ValidationError to allow persisting error params and error codes ↵Loic Bistuer
as the exception bubbles up
2013-06-16Fixed #20583 -- ORM always uses setup_joins() for join generationAnssi Kääriäinen
There were a couple of places which used Query.join() directly. By using setup_joins() in these places the code is more DRY, and in addition there is no need to directly call field.get_joining_columns() unless the field is the given join_field from get_path_info(). This makes it easier to make sure a ForeignObject subclass generates joins correctly in all cases.
2013-06-14Fixed #20289 -- pickling of dynamic modelsAnssi Kääriäinen
2013-06-14Fixed #20528 -- regression in select_related join promotionAnssi Kääriäinen
The join used by select_related was incorrectly INNER when the query had an ORed filter for nullable join that was trimmed away. Fixed this by forcing the join type to LOUTER even when a join was trimmed away in ORed queries.
2013-06-13Fixed #20594 -- Add validation to models.SlugField.Baptiste Mispelon
Thanks carbonXT for the report.
2013-06-10Added TransactionTestCase.available_apps.Aymeric Augustin
This can be used to make Django's test suite significantly faster by reducing the number of models for which content types and permissions must be created and tables must be flushed in each non-transactional test. It's documented for Django contributors and committers but it's branded as a private API to preserve our freedom to change it in the future. Most of the credit goes to Anssi. He got the idea and did the research. Fixed #20483.
2013-06-09Replaced a dict emulating a set with a set.Aymeric Augustin
2013-06-07Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/models/fields/related.py
2013-06-06Fixed #20564 -- Generic relations exclude() regressionAnssi Kääriäinen
The patch for #19385 caused a regression in certain generic relations .exclude() filters if a subquery was needed. The fix contains a refactoring to how Query.split_exclude() and Query.trim_start() interact. Thanks to Trac alias nferrari for the report.
2013-06-02Added get_app_paths() to the AppCache.Aymeric Augustin
This method is useful to discover files inside apps.
2013-06-01Fixed #20337 -- Clarified error message when database relation is not allowed.Dan Loewenherz
2013-05-30Fixed #16856 - Added a way to clear select_related.Tim Graham
Thanks Carl for the suggestion and David Cramer for the patch.
2013-05-30Fixed #20272 - Moved update_fields existence check into Model._do_update.Tim Graham
Thanks Gavin Wahl.
2013-05-30Fixed #16436 -- defer + annotate + select_related crashTai Lee
Correctly calculate the ``aggregate_start`` offset from loaded fields, if any are deferred, instead of ``self.query.select`` which includes all fields on the model. Also made some PEP 8 fixes.
2013-05-27Fixed #16137 - Removed kwargs requirement for QuerySet.get_or_createTim Graham
Thanks wilfred@, poirier, and charettes for work on the patch.
2013-05-27Fixed #17582 - Added message to DoesNotExist exceptions.Tim Graham
Thanks simon@ for the suggestion and JordanPowell for the initial patch.
2013-05-27Fixed #20507 -- SubqueryConstraint alias relabelingAnssi Kääriäinen
The SubqueryConstraint defined relabeled_clone(), but that was never called. Instead there is now clone() and relabel_aliases() methods for SubqueryConstraint. A related problem was that SubqueryConstraint didn't correctly use quote_name_unless_alias() of the outer query. This resulted in failures when running under PostgreSQL.
2013-05-26Replaced `and...or...` constructs with PEP 308 conditional expressions.Ramiro Morales
2013-05-24Optimisation in prefetch_related_objectsLuke Plant
2013-05-24Fixed #19607 - prefetch_related crashLuke Plant
Thanks to av@rdf.ru and flarno11@yahoo.de for the report.
2013-05-23Fixed #11398 - Added a pre_syncdb signalDonald Stufft
2013-05-22Fixed #20463 -- Made get_or_create more robust.Aymeric Augustin
When an exception other than IntegrityError was raised, get_or_create could fail and leave the database connection in an unusable state. Thanks UloPe for the report.
2013-05-21Fixed #18702 -- Removed chunked reads from QuerySet iterationAnssi Kääriäinen
2013-05-21Fixed #19326 -- Added first() and last() methods to QuerySetSelwin Ong
2013-05-20Fixed #9321 -- Deprecated hard-coding of help text in model ManyToManyField ↵Ramiro Morales
fields. This is backward incompatible for custom form field/widgets that rely on the hard-coded 'Hold down "Control", or "Command" on a Mac, to select more than one.' sentence. Application that use standard model form fields and widgets aren't affected but need to start handling these help texts by themselves before Django 1.8. For more details, see the related release notes and deprecation timeline sections added with this commit.