'Convenience method for getting or creating revision.'

@classmethod
def get_or_create_revision(cls, revision=None):

    if (revision is None):
        revision = str(uuid.uuid4())
    (obj, created) = cls.objects.get_or_create(pk=1, defaults=dict(revision=revision))
    return (obj.revision, created)
