l.s.f.UniqueField(TextLine) : class documentation

Part of lp.services.fields View In Hierarchy

Known subclasses: lp.code.browser.gitrepository.GitRulePatternField, lp.registry.interfaces.distroseries.DistroSeriesVersionField, lp.services.fields.ContentNameField

Base class for fields that are used for unique attributes.
Method unchanged Return True if the attribute on the object is unchanged.
Method _content_iface Return the content interface.
Method _getByAttribute Return the content object with the given attribute.
Method _isValueTaken Returns true if and only if the specified value is already taken.
Method _validate Raise a LaunchpadValidationError if the attribute is not available.
@property
def _content_iface(self):
Return the content interface.

Override this in subclasses.

def _getByAttribute(self, input):
Return the content object with the given attribute.

Override this in subclasses.

def _isValueTaken(self, value):
Returns true if and only if the specified value is already taken.
def unchanged(self, input):
Return True if the attribute on the object is unchanged.
def _validate(self, input):
Raise a LaunchpadValidationError if the attribute is not available.

A attribute is not available if it's already in use by another object of this same context. The 'input' should be valid as per TextLine.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.