I am new to Django. I want the functionality of Accounts and Transactions. Account can have three types of transactions. Income, Expense and Transfer. All of them have some common fields among them. But also have some additional fields. I want to know can I make such models so that I can access all the ..
I’m trying to add a like/dislike functionality in Django using generic relationships. Can someone help me? My post model class Post(models.Model): title = models.CharField(max_length=225) post_image = models.ImageField(null=True, blank=True, upload_to="images/") author = models.ForeignKey(User, on_delete=models.CASCADE) body = models.TextField() post_date = models.DateTimeField(auto_now_add=True) def __str__(self): return self.title + ‘ | ‘ + str(self.author) class Meta: ordering = [‘-post_date’,] def ..