| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
Thanks Anssi Kääriäinen for the suggestion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
customizable.
Overriding the error messages now works for both unique fields, unique_together
and unique_for_date.
This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS
since previously only fields' errors were customizable.
Refs #20199.
Thanks leahculver for the suggestion.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
framework
This is the result of Christopher Medrela's 2013 Summer of Code project.
Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.
Also: Fixes #8579, fixes #3055, fixes #19844.
|
|
|
|
| |
_ptr fields
|
|
|
|
|
|
| |
As far as I can tell, they don't need an app_label.
Thanks Simon Charette for the report and the review.
|
|
|
|
| |
Refs #21719, #21680.
|
| |
|
|
|
|
|
|
| |
configuration.
Fixed #21683.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.
get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.
Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
|
|
|
|
|
|
| |
Also renamed app_cache to apps and "app cache" to "app registry".
Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
|
|
|
|
| |
That matches its return type better.
|
|
|
|
| |
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
|
|
|
|
|
|
| |
This avoids possible confusion with register_model.
Thanks Marc Tamlyn for the suggestion.
|
|
|
|
|
|
|
|
|
|
| |
It was called _populate() before I renamed it to populate(). Since it
has been superseded by populate_models() there's no reason to keep it.
Removed the can_postpone argument of load_app() as it was only used by
populate(). It's a private API and there's no replacement. Simplified
load_app() accordingly. Then new version behaves exactly like the old
one even though it's much shorter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Got rid of AppConfig._stub. As a side effect, app_cache.app_configs now
only contains entries for applications that are in INSTALLED_APPS, which
is a good thing and will allow dramatic simplifications (which I will
perform in the next commit). That required adjusting all methods that
iterate on app_configs without checking the "installed" flag, hence the
large changes in get_model[s].
Introduced AppCache.all_models to store models:
- while the app cache is being populated and a suitable app config
object to register models isn't available yet;
- for applications that aren't in INSTALLED_APPS since they don't have
an app config any longer.
Replaced get_model(seed_cache=False) by registered_model() which can be
kept simple and safe to call at any time, and removed the seed_cache
argument to get_model[s]. There's no replacement for that private API.
Allowed non-master app caches to go through populate() as it is now
safe to do so. They were introduced in 1.7 so backwards compatibility
isn't a concern as long as the migrations framework keeps working.
|
| |
|
|
|
|
|
| |
Since it's never called with more than one model at a time the current
signature is needlessly complicated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.
They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.
This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
|
|
|
|
| |
This commit doesn't contain any code changes; it's purely a refactoring.
|
| |
|
|
|
|
|
|
| |
Refs #20199 #16986.
Thanks @akaariai, @bmispelon, @mjtamlyn, @timgraham for the reviews.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
@python_2_unicode_compatible.
Thanks jpic for the report and chmodas for working on a patch.
Reverts 2ea80b94. Refs #19362.
|
| |
|
|
|
|
| |
pyflakes warnings.
|
|
|
|
|
| |
It's now forbidden to call queryset.update(field=instance) when instance
hasn't been saved to the database ie. instance.pk is None.
|
| |
|
|
|
|
| |
comprehensions.
|
|
|
|
|
|
|
|
|
|
|
| |
The option can be used to force pre 1.6 style SELECT on save behaviour.
This is needed in case the database returns zero updated rows even if
there is a matching row in the DB. One such case is PostgreSQL update
trigger that returns NULL.
Reviewed by Tim Graham.
Refs #16649
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
schema-alteration
Conflicts:
django/db/backends/oracle/base.py
django/db/backends/postgresql_psycopg2/base.py
django/db/models/signals.py
tests/queries/tests.py
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The __eq__ method now considers two instances without primary key value
equal only when they have same id(). The __hash__ method raises
TypeError for no primary key case.
Fixed #18864, fixed #18250
Thanks to Tim Graham for docs review.
|
|\|
| |
| |
| |
| |
| |
| | |
schema-alteration
Conflicts:
docs/ref/django-admin.txt
|
| |
| |
| |
| | |
Fixed #11892, fixed #16458, fixed #14492.
|
| |
| |
| |
| | |
in abstract parents
|
|\|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
without the need to specify app_label.
Thanks mark@ and Aramgutang for work on the patch.
|
| | |
|
|\|
| |
| |
| |
| |
| |
| | |
schema-alteration
Conflicts:
django/db/models/loading.py
|
| |
| |
| |
| | |
params and error codes as the exception bubbles up
|
| | |
|
|\|
| |
| |
| |
| |
| |
| | |
schema-alteration
Conflicts:
django/db/models/fields/related.py
|
| |
| |
| |
| |
| |
| | |
Model._do_update.
Thanks Gavin Wahl.
|
|\| |
|
| |
| |
| |
| | |
Thanks Lennart Regebro for pointing it out.
|