App Engine Python SDK version 1.7.4 (2)
[gae.git] / python / lib / django_1_4 / tests / modeltests / m2m_signals / models.py
blob526c4a782ecd3b32633a4b0712436eaebf30e0e8
1 from django.db import models
4 class Part(models.Model):
5 name = models.CharField(max_length=20)
7 class Meta:
8 ordering = ('name',)
10 def __unicode__(self):
11 return self.name
13 class Car(models.Model):
14 name = models.CharField(max_length=20)
15 default_parts = models.ManyToManyField(Part)
16 optional_parts = models.ManyToManyField(Part, related_name='cars_optional')
18 class Meta:
19 ordering = ('name',)
21 def __unicode__(self):
22 return self.name
24 class SportsCar(Car):
25 price = models.IntegerField()
27 class Person(models.Model):
28 name = models.CharField(max_length=20)
29 fans = models.ManyToManyField('self', related_name='idols', symmetrical=False)
30 friends = models.ManyToManyField('self')
32 class Meta:
33 ordering = ('name',)
35 def __unicode__(self):
36 return self.name