Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Book(Model):
- __tablename__ = 'BookCart'
- title = CharField(max_length=256)
- authors = ManyToManyField('Author')
- series = ForeignKey('Series', null=True)
- sub_genres = ManyToManyField('SubGenre')
- class BookPublication(Model):
- """ Abstract class for relate book and publication of two types (paper, electronic) """
- class Meta:
- abstract = True
- book = ForeignKey('Book', null=False)
- year_of_publishing = IntegerField()
- annotation = TextField()
- class BookPublicationPaper(BookPublication):
- __tablename__ = 'BookPaper'
- isbn = IntegerField()
- count_of_pages = IntegerField()
- physical_type = CharField(max_length=64)
- location = CharField(max_length=128)
- class BookPublicationElectronic(BookPublication):
- __tablename__ = 'BookElectronic'
- cover_local_path = FilePathField()
- path_to_file = FilePathField()
- class OwnedBook(Model):
- """ Book in your collection. For relation to quotes, diary, etc. """
- __tablename__ = 'OwnedBook'
- publication = ForeignKey('BookPublication')
- tags = ManyToManyField('Tag')
- reviews = ManyToManyField('Review')
- quote = ManyToManyField('Quote')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement