'Look up a single app by its `id` or `app_slug`.
If the identifier is coercable into an integer, we first check for an
ID match, falling back to a slug check (probably not necessary, as
there is validation preventing numeric slugs). Otherwise, we only look
for a slug match.'

def by_identifier(self, identifier):

    try:
        return self.get(id=identifier)
    except (ObjectDoesNotExist, ValueError):
        return self.get(app_slug=identifier)
