Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Airline(models.Model):
- code = models.CharField(max_length=3, db_index=True, unique=True)
- name = models.CharField(max_length=100)
- def __unicode__(self):
- return u"%s (%s)" % (self.name, self.code)
- class Airport(models.Model):
- code = models.CharField(max_length=4, db_index=True, unique=True)
- name = models.CharField(max_length=100)
- airlines = models.ManyToManyField(Airline)
- def __unicode__(self):
- return u"%s" % self.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement