mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-27 16:26:50 +01:00
34d0da70d9
Also remove type annotations for Django fields, due to updates to the stubs and possibly to mypy they are actively unhelpful now.
22 lines
674 B
Python
22 lines
674 B
Python
from django.db import models
|
|
|
|
|
|
class FeatureFlagRoleAccess(models.Model):
|
|
feature_flag = models.ForeignKey(
|
|
"posthog.FeatureFlag",
|
|
on_delete=models.CASCADE,
|
|
related_name="access",
|
|
related_query_name="access",
|
|
)
|
|
role = models.ForeignKey(
|
|
"Role",
|
|
on_delete=models.CASCADE,
|
|
related_name="feature_flag_access",
|
|
related_query_name="feature_flag_access",
|
|
)
|
|
added_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
class Meta:
|
|
constraints = [models.UniqueConstraint(fields=["role", "feature_flag"], name="unique_feature_flag_and_role")]
|