mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #14007 -- Added model discovery in models module without the need to specify app_label.
Thanks mark@ and Aramgutang for work on the patch.
This commit is contained in:
parent
fba6c2ede7
commit
2333c9662b
7 changed files with 30 additions and 17 deletions
|
@ -24,12 +24,17 @@ Available ``Meta`` options
|
|||
|
||||
.. attribute:: Options.app_label
|
||||
|
||||
If a model exists outside of the standard :file:`models.py` (for instance,
|
||||
if the app's models are in submodules of ``myapp.models``), the model must
|
||||
define which app it is part of::
|
||||
If a model exists outside of the standard locations (:file:`models.py` or
|
||||
a ``models`` package in an app), the model must define which app it is part
|
||||
of::
|
||||
|
||||
app_label = 'myapp'
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
``app_label`` is no longer required for models that are defined
|
||||
in a ``models`` package within an app.
|
||||
|
||||
``db_table``
|
||||
------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue