'Return a single Extension from an identifier, slug or pk.'

def by_identifier(self, identifier):

    if unicode(identifier).isdigit():
        return self.get(pk=int(identifier))
    else:
        return self.get(slug=identifier)
