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

« back to all changes in this revision

Viewing changes to tests/inline_formsets/models.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-11-07 15:33:49 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131107153349-e31sc149l2szs3jb
Tags: 1.6-1
* New upstream version. Closes: #557474, #724637.
* python-django now also suggests the installation of ipython,
  bpython, python-django-doc, and libgdal1.
  Closes: #636511, #686333, #704203
* Set package maintainer to Debian Python Modules Team.
* Bump standards version to 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# coding: utf-8
 
2
from django.db import models
 
3
from django.utils.encoding import python_2_unicode_compatible
 
4
 
 
5
 
 
6
class School(models.Model):
 
7
    name = models.CharField(max_length=100)
 
8
 
 
9
class Parent(models.Model):
 
10
    name = models.CharField(max_length=100)
 
11
 
 
12
class Child(models.Model):
 
13
    mother = models.ForeignKey(Parent, related_name='mothers_children')
 
14
    father = models.ForeignKey(Parent, related_name='fathers_children')
 
15
    school = models.ForeignKey(School)
 
16
    name = models.CharField(max_length=100)
 
17
 
 
18
@python_2_unicode_compatible
 
19
class Poet(models.Model):
 
20
    name = models.CharField(max_length=100)
 
21
 
 
22
    def __str__(self):
 
23
        return self.name
 
24
 
 
25
@python_2_unicode_compatible
 
26
class Poem(models.Model):
 
27
    poet = models.ForeignKey(Poet)
 
28
    name = models.CharField(max_length=100)
 
29
 
 
30
    def __str__(self):
 
31
        return self.name