Task #3950
Updated by jortel@redhat.com about 6 years ago
Create the Tag model. Tag(Content): * name CharField(255) CharField(max_length=255, db_index=True) * manifest ForeignKey(Manifest, related_name='tags', on_delete=CASCADE) * manifest_list ForeignKey(ManifestList, related_name='tags', on_delete=CASCADE) unique_together = (name, manifest) unique_together = (name, manifest_list) Pre-save validation on the model will prevent both manifest and manifest_list from being set. Tag name uniqueness and referential integrity{1} will be enforced by the plugin. During sync, this happens in the task logic. For content add/remove API calls, this happens in the (docker specific) view. Both can re-use the same code. *[1]* Tag referential integrity is ensuring that when a manifest or manifest_list is removed from a repository, referencing tags are also removed. Also, when a tag is added to a repository, referenced manifest or manifest_list are also added.