Closed jathanism closed 6 years ago
ProtocolType.site
required_attributes
ProtocolType
ProtocolType.name
unique_together
site
name
ProtocolType.required_attributes
Protocol.clean_type()
Protocol.set_attributes()
Resource.set_attributes()
Resource.save()
valid_attributes
.set_attributes()
nsot.api.serializers.NaturalKeyRelatedField
Looks pretty good! Only a couple of comments.
Standard disclaimer: anything marked with suggestion: is entirely optional
suggestion:
Looks good to me!
ProtocolType.site
sincerequired_attributes
are site-specific, so must beProtocolType
.ProtocolType.name
unique constraint withunique_together
constraint onsite
andname
fields (Uniqueness enforced at site boundary).ProtocolType.required_attributes
validation fromProtocol.clean_type()
toProtocol.set_attributes()
(which overloadsResource.set_attributes()
Protocol.clean_type()
to validate that the incoming type matches the site.Resource.save()
(abstract base) now optionally takes avalid_attributes
argument that gets passed to.set_attributes()
nsot.api.serializers.NaturalKeyRelatedField
that was causing site-level-limiting in related fields to not work correctly.