~ubuntu-branches/ubuntu/trusty/python-django/trusty

« back to all changes in this revision

Viewing changes to tests/prefetch_related/models.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-12-12 15:46:01 UTC
  • mfrom: (1.1.26) (4.4.32 sid)
  • Revision ID: package-import@ubuntu.com-20131212154601-k236saafzyyuwkje
Tags: 1.6.1-1
* New upstream version.
* Fix broken encoding in translations attribution. (Closes: #729194)

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
 
216
216
    def __str__(self):
217
217
        return "%s (%s)" % (self.name, self.id)
 
218
 
 
219
 
 
220
## Ticket #21410: Regression when related_name="+"
 
221
 
 
222
@python_2_unicode_compatible
 
223
class Author2(models.Model):
 
224
    name = models.CharField(max_length=50, unique=True)
 
225
    first_book = models.ForeignKey('Book', related_name='first_time_authors+')
 
226
    favorite_books = models.ManyToManyField('Book', related_name='+')
 
227
 
 
228
    def __str__(self):
 
229
        return self.name
 
230
 
 
231
    class Meta:
 
232
        ordering = ['id']