I have the following model in Django:
class Foo(models.Model):
name = models.TextField()
permission = models.ForeignKey(Permission, null=True, blank=True)
class Meta:
permissions = (
('permA', 'permA only for alpha-users'),
('permB', 'permB only for beta-users'),
)
The problem is, that the permission-attribute in the class Foo could be any permission. But I would only allow the permissions which I have defined in the Meta class. So 'permA' and 'permB'. Can someone help me with this?
Thank you!