group: "group_name"

This commit is contained in:
Emmanuel Viennet 2022-08-02 09:48:11 +02:00
parent bfec7b7a6d
commit 1f4cb5700e

View File

@ -129,12 +129,8 @@ class GroupDescr(db.Model):
def to_dict(self, with_partition=True) -> dict:
"""as a dict, with or without partition"""
d = {
"id": self.id,
"partition_id": self.partition_id,
"name": self.group_name,
"numero": self.numero,
}
d = dict(self.__dict__)
d.pop("_sa_instance_state", None)
if with_partition:
d["partition"] = self.partition.to_dict(with_groups=False)
return d