def by_apikey(cls, apikey): if apikey is not None: return session.query(cls).filter_by(apikey=apikey).first()
def by_slug(cls, slug): if slug is None: return return session.query(cls).filter_by(slug=slug).first()
def by_id(cls, id): if id is not None: return session.query(cls).filter_by(id=id).first()