1
0
forked from ScoDoc/ScoDoc

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: def to_dict(self, with_partition=True) -> dict:
"""as a dict, with or without partition""" """as a dict, with or without partition"""
d = { d = dict(self.__dict__)
"id": self.id, d.pop("_sa_instance_state", None)
"partition_id": self.partition_id,
"name": self.group_name,
"numero": self.numero,
}
if with_partition: if with_partition:
d["partition"] = self.partition.to_dict(with_groups=False) d["partition"] = self.partition.to_dict(with_groups=False)
return d return d