Added some logic
This commit is contained in:
11
backend/apps/books/models.py
Normal file
11
backend/apps/books/models.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user