class Book(models.Model): name = models.CharField(max_length=50) synopsis = models.CharField(max_length=255) book_type = models.CharField(max_length=15, null=True, choices=BOOK_CHOICES) pages = models.IntegerField(null=True) date_created = models.DateField(auto_now=True) author = models.ManyToManyField(foreign_key="Author") class Meta: ordering = ["-name"] unique_together = ["name", "synopsis"]
class Developer(models.Model): name = models.CharField(max_length=50, unique=True) age = models.IntegerField(default=25) org = models.ManyToManyField(foreign_key='Organization')
class Author(models.Model): na = models.PkField(db_column='uid') name = models.CharField(max_length=50, unique=True) email = models.EmailField(max_length=100, null=True) age = models.IntegerField() publisher = models.ManyToManyField(foreign_key='Publisher')
class Author(models.Model): na = models.AutoField(db_column="uid") name = models.CharField(max_length=50, unique=True, db_index=True) email = models.EmailField(max_length=100, null=True, db_index=True) age = models.IntegerField() publisher = models.ManyToManyField(foreign_key="Publisher")