ObjectSet#
- class ansys.dynamicreporting.core.serverless.base.ObjectSet(_model: type[BaseModel] = None, _obj_set: list[BaseModel] = <factory>, _orm_model: type[Model] = None, _orm_queryset: QuerySet = None, _parent: BaseModel = None)#
Bases:
objectCollection wrapper around a queryset of
BaseModelobjects.An
ObjectSetencapsulates a Django queryset and eagerly materializes it into a list ofBaseModelinstances. It behaves like a simple list for iteration, indexing, and truth testing, while providing extra helpers such as bulk deletion and value extraction.Methods
Delete all objects in this set from the database.
ObjectSet.values_list(*fields[, flat])Return a list of tuples of field values for objects in the set.
Attributes
Whether this object set currently reflects saved ORM rows.
- delete()#
Delete all objects in this set from the database.
The individual objects’
BaseModel.delete()methods are called, followed by deletion of any remaining rows via the underlying queryset.- Returns:
intNumber of objects deleted.
- property saved#
Whether this object set currently reflects saved ORM rows.
- values_list(*fields, flat=False)#
Return a list of tuples of field values for objects in the set.
- Parameters:
- Returns:
listList of tuples of field values, or a flat list of values if
flat=Trueand a single field is requested.
- Raises:
ValueErrorIf
flatisTruebut more than one field name is provided.