| 43 | |
| 44 | |
| 45 | class Project(LifecycleModelMixin, SoftDeleteExportableModel): # type: ignore[django-manager-missing,misc] |
| 46 | name = models.CharField(max_length=2000) |
| 47 | created_date = models.DateTimeField("DateCreated", auto_now_add=True) |
| 48 | organisation = models.ForeignKey( |
| 49 | Organisation, related_name="projects", on_delete=models.CASCADE |
| 50 | ) |
| 51 | hide_disabled_flags = models.BooleanField( |
| 52 | default=False, |
| 53 | help_text="If true will exclude flags from SDK which are disabled", |
| 54 | ) |
| 55 | enable_dynamo_db = models.BooleanField( |
| 56 | default=False, |
| 57 | help_text="If true will sync environment data with dynamodb and allow access to dynamodb identities", |
| 58 | ) |
| 59 | prevent_flag_defaults = models.BooleanField( |
| 60 | default=False, |
| 61 | help_text="Prevent defaults from being set in all environments when creating a feature.", |
| 62 | ) |
| 63 | enforce_feature_owners = models.BooleanField( |
| 64 | default=False, |
| 65 | help_text="Require at least one user or group owner when creating a feature.", |
| 66 | ) |
| 67 | enable_realtime_updates = models.BooleanField( |
| 68 | default=False, |
| 69 | help_text="Enable this to trigger a realtime(sse) event whenever the value of a flag changes", |
| 70 | ) |
| 71 | only_allow_lower_case_feature_names = models.BooleanField( |
| 72 | default=True, help_text="Used by UI to validate feature names" |
| 73 | ) |
| 74 | feature_name_regex = models.CharField( |
| 75 | null=True, |
| 76 | blank=True, |
| 77 | max_length=255, |
| 78 | help_text="Used for validating feature names", |
| 79 | ) |
| 80 | max_segments_allowed = models.IntegerField( |
| 81 | default=500, help_text="Max segments allowed for this project" |
| 82 | ) |
| 83 | max_features_allowed = models.IntegerField( |
| 84 | default=1000, help_text="Max features allowed for this project" |
| 85 | ) |
| 86 | max_segment_overrides_allowed = models.IntegerField( |
| 87 | default=2000, |
| 88 | help_text="Max segments overrides allowed for any (one) environment within this project", |
| 89 | ) |
| 90 | edge_v2_migration_status = models.CharField( |
| 91 | max_length=50, |
| 92 | choices=EdgeV2MigrationStatus.choices, |
| 93 | # Note that the default is actually set dynamically by a lifecycle hook on create |
| 94 | # since we need to know whether edge is enabled or not. |
| 95 | default=EdgeV2MigrationStatus.NOT_STARTED, |
| 96 | db_column="identity_overrides_v2_migration_status", |
| 97 | help_text="[Edge V2 migration] Project migration status. Set to `IN_PROGRESS` to trigger migration start.", |
| 98 | ) |
| 99 | edge_v2_migration_read_capacity_budget = models.IntegerField( |
| 100 | null=True, |
| 101 | blank=True, |
| 102 | default=None, |
searching dependent graphs…