10 lines
366 B
Python
10 lines
366 B
Python
from django.db import models
|
|
|
|
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="books")
|
|
authors = models.ManyToManyField(Author, related_name="books")
|
|
name = models.CharField(max_length=255)
|
|
isbn = models.CharField(max_length=13) |