11 lines
406 B
Python
11 lines
406 B
Python
from django.db import models
|
|
|
|
from apps.shelves.models import Shelf
|
|
from apps.authors.models import Author
|
|
from apps.user.models import User
|
|
|
|
class Book(models.Model):
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="Authors")
|
|
authors = models.ManyToManyField(Author, related_name="books")
|
|
name = models.CharField(max_length=255)
|
|
isbn = models.CharField(max_length=13) |