mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #9638 - Added %(app_label)s to the related_name format string for abstract models.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1e955e0143
commit
bacfe3f3e8
7 changed files with 112 additions and 18 deletions
19
tests/modeltests/model_inheritance_same_model_name/models.py
Normal file
19
tests/modeltests/model_inheritance_same_model_name/models.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
"""
|
||||
XX. Model inheritance
|
||||
|
||||
Model inheritance across apps can result in models with the same name resulting
|
||||
in the need for an %(app_label)s format string. This app specifically tests
|
||||
this feature by redefining the Copy model from model_inheritance/models.py
|
||||
"""
|
||||
|
||||
from django.db import models
|
||||
from modeltests.model_inheritance.models import NamedURL
|
||||
|
||||
#
|
||||
# Abstract base classes with related models
|
||||
#
|
||||
class Copy(NamedURL):
|
||||
content = models.TextField()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.content
|
Loading…
Add table
Add a link
Reference in a new issue