1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #26421 -- Refactored Apps.lazy_model_operation() for better checks and tests

This commit is contained in:
Alex Hill
2016-05-18 23:18:40 +08:00
committed by Tim Graham
parent 0eac5535f7
commit 2ff7ef15b0
9 changed files with 239 additions and 96 deletions

View File

@@ -138,6 +138,9 @@ Models
* **models.E020**: The ``<model>.check()`` class method is currently overridden.
* **models.E021**: ``ordering`` and ``order_with_respect_to`` cannot be used
together.
* **models.E022**: ``<function>`` contains a lazy reference to
``<app label>>.<model>``, but app ``<app label>`` isn't installed or
doesn't provide model ``<model>``.
Fields
~~~~~~
@@ -200,6 +203,9 @@ Related Fields
for ``<field name>``.
* **fields.E306**: Related name must be a valid Python identifier or end with
a ``'+'``.
* **fields.E307**: The field ``<app label>.<model>.<field name>`` was declared
with a lazy reference to ``<app label>.<model>``, but app ``<app label>``
isn't installed or doesn't provide model ``<model>``.
* **fields.E310**: No subset of the fields ``<field1>``, ``<field2>``, ... on
model ``<model>`` is unique. Add ``unique=True`` on any of those fields or
add at least a subset of them to a unique_together constraint.