-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
class Author(BaseSBModel):
pass
class Book(BaseSBModel):
author: Author = fields.ForeignKey()
author = Author()
book = Book(user=user).save()
book = Book.objects.create(user=user)
# Should work like this
Book.objects.filter(author=author)
Book.objects.filter(author_id=author.id)
book = Book.objects.get(book_id=book.id)
# Get author object (lazy loadings)
book.author
# Get author id
book.author_id