I have the following models.
class Post(models.Model):
content = models.TextField()
class User(AbstractUser):
pen_name = models.Charfield()
I want to restrict a user to create a specific number of posts (let's say 10) and no more than that. Also, I want the permission to expire by a certain date.
These models are representative, my original models have many more fields and need many more permissions. But for all of those, I basically need to restrict the count and expiry date. I want to have a licensing functionality by using the permissions. So a user may purchase a license to make 'n' posts in a year.
How do I achieve this, for APIViews and permission_classes in DRF?