You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model called Books and an API to add books and update the ratings.
class Book(models.Model):
name = models.CharField(max_length=200, blank=True, null=True)
user = models.ForeignKey(User, on_delete=models.CASCADE)
ratings = GenericRelation(Rating, related_query_name="books")
I read the documentation, I have a few questions
1 . how to add ratings i.e how to use them in my views directly. I would like to know your view on this.
2. I went and checked out the model definition. there I found 2 of them. I am thinking this is the model. Can you give me a brief on how to use this i.e if this is the one to use.
The text was updated successfully, but these errors were encountered:
I have a model called
Books
and an API to add books and update the ratings.I read the documentation, I have a few questions
1 . how to add ratings i.e how to use them in my views directly. I would like to know your view on this.
2. I went and checked out the model definition. there I found 2 of them. I am thinking this is the model. Can you give me a brief on how to use this i.e if this is the one to use.
The text was updated successfully, but these errors were encountered: