MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / MetadataModelFieldRequirement

Class MetadataModelFieldRequirement

api/metadata/models.py:100–114  ·  view source on GitHub ↗

This model stores information about the requirement status of a `MetadataModelField` with respect to a parent object. e.g: if the `MetadataModelField` is attached to an `Environment` model, the parent object can be an instance of `Project` or `Organization`.

Source from the content-addressed store, hash-verified

98
99
100class MetadataModelFieldRequirement(AbstractBaseExportableModel):
101 """This model stores information about the requirement status of a `MetadataModelField` with respect to
102 a parent object. e.g: if the `MetadataModelField` is attached to an `Environment` model,
103 the parent object can be an instance of `Project` or `Organization`.
104 """
105
106 content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
107 object_id = GenericObjectID()
108 content_object = GenericForeignKey("content_type", "object_id")
109 model_field = models.ForeignKey(
110 MetadataModelField, on_delete=models.CASCADE, related_name="is_required_for"
111 )
112
113 class Meta:
114 unique_together = ("content_type", "object_id", "model_field")
115
116
117class Metadata(AbstractBaseExportableModel):

Callers

nothing calls this directly

Calls 1

GenericObjectIDClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…