Advertisement
Guest User

Untitled

a guest
Nov 28th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. class Airline(models.Model):
  2.  
  3.     code = models.CharField(max_length=3, db_index=True, unique=True)
  4.     name = models.CharField(max_length=100)
  5.  
  6.     def __unicode__(self):
  7.         return u"%s (%s)" % (self.name, self.code)
  8.  
  9.  
  10. class Airport(models.Model):
  11.  
  12.     code = models.CharField(max_length=4, db_index=True, unique=True)
  13.     name = models.CharField(max_length=100)
  14.     airlines = models.ManyToManyField(Airline)
  15.  
  16.     def __unicode__(self):
  17.         return u"%s" % self.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement