0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-27 16:26:50 +01:00
posthog/ee/models/feature_flag_role_access.py
Julian Bez 34d0da70d9
chore(deps): Upgrade mypy, stubs, and ruff (#24500)
Also remove type annotations for Django fields, due to updates to the 
stubs and possibly to mypy they are actively unhelpful now.
2024-08-22 09:42:25 +00:00

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")]