Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # testdb/models.py
- from django.db import models
- class Author(models.Model):
- last_name = models.CharField(max_length=200)
- first_name = models.CharField(max_length=200)
- birth_date = models.DateField()
- class Meta:
- db_table = 'authors'
- class Language(models.Model):
- name = models.CharField(max_length=200)
- class Meta:
- db_table = 'languages'
- class Book(models.Model):
- title = models.CharField(max_length=200)
- authors = models.ManyToManyField(Author)
- available_languages = models.ManyToManyField(Language)
- class Meta:
- db_table = 'books'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement