tacker.db.db_sqlalchemy.api module

tacker.db.db_sqlalchemy.api.model_query(context, model, args=None, read_deleted=None, project_only=False)

Query helper that accounts for context’s read_deleted field.

  • context – TackerContext of the query.

  • model – Model to query. Must be a subclass of ModelBase.

  • args – Arguments to query. If None - model is used.

  • read_deleted – If not None, overrides context’s read_deleted field. Permitted values are ‘no’, which does not return deleted values; ‘only’, which only returns deleted values; and ‘yes’, which does not filter deleted values.

  • project_only – If set and context is user-type, then restrict query to match the context’s project_id. If set to ‘allow_none’, restriction includes project_id = None.