forked from ScoDoc/ScoDoc
group: "group_name"
This commit is contained in:
parent
bfec7b7a6d
commit
1f4cb5700e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user