def all(cls, dataset, eager=False): q = cls.query.filter_by(dataset=dataset) if eager: q = q.options(db.joinedload('matcher')) q = q.options(db.joinedload('creator')) q = q.options(db.joinedload('entity')) q = q.options(db.joinedload('dataset')) return q
def all(cls, dataset, eager=False): q = cls.query.filter_by(dataset=dataset) if eager: q = q.options(db.joinedload("matcher")) q = q.options(db.joinedload("creator")) q = q.options(db.joinedload("value")) q = q.options(db.joinedload("dataset")) return q
def all(cls, dataset, query=None, eager_aliases=False, eager=False): q = cls.query.filter_by(dataset=dataset) if query is not None and len(query.strip()): q = q.filter(cls.name.ilike('%%%s%%' % query.strip())) if eager_aliases: q = q.options(joinedload_all(cls.aliases_static)) if eager: q = q.options(db.joinedload('dataset')) q = q.options(db.joinedload('creator')) return q