1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +00:00

Add serializer to Condition

This commit is contained in:
Stefano Pigozzi 2021-04-29 04:35:51 +02:00
parent 0fcbc64191
commit 344544da52
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01

View file

@ -15,3 +15,10 @@ class Condition(Base.Model):
used = Base.relationship("Uses", back_populates="condition")
tweets = Base.relationship("Contains", back_populates="condition")
operations = Base.relationship("BoolOperation", back_populates="condition")
def to_json(self):
return {
"id": self.id,
"type": self.type,
"content": self.content,
}