Add some docstrings.
@@ -209,6 +209,11 @@ class UIDFieldMixin(object):
return indexes
def get_uid(self):
+ """
+ Return an object UID constructed from the object properties / fields.
+
+ :rtype: ``str``
+ """
parts = []
parts.append(self.RESOURCE_TYPE)
@@ -220,11 +225,21 @@ class UIDFieldMixin(object):
return uid
def get_uid_parts(self):
+ """
+ Return values for fields which make up the UID.
+
+ :rtype: ``list``
+ """
parts = self.uid.split(self.UID_SEPARATOR)
parts = [part for part in parts if part.strip()]
return parts
def has_valid_uid(self):
+ """
+ Return True if object contains a valid id (aka all parts contain a valid value).
+
+ :rtype: ``bool``
+ """
parts = self.get_uid_parts()
return len(parts) == len(self.UID_FIELDS) + 1
