~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to tests/model_inheritance/same_model_name/models.py

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2014-09-17 14:15:11 UTC
  • mfrom: (1.3.17) (6.2.18 experimental)
  • Revision ID: package-import@ubuntu.com-20140917141511-icneokthe9ww5sk4
Tags: 1.7-2
* Release to unstable.
* Add a migrate-south sample script to help users apply their South
  migrations. Thanks to Brian May.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
 
 
3
Model inheritance across apps can result in models with the same name,
 
4
requiring an %(app_label)s format string. This app tests this feature by
 
5
redefining the Copy model from model_inheritance/models.py.
 
6
"""
 
7
 
 
8
from django.db import models
 
9
 
 
10
from model_inheritance.models import NamedURL
 
11
from django.utils.encoding import python_2_unicode_compatible
 
12
 
 
13
 
 
14
@python_2_unicode_compatible
 
15
class Copy(NamedURL):
 
16
    content = models.TextField()
 
17
 
 
18
    def __str__(self):
 
19
        return self.content