From 08b909b9a80960770f6ba7008189b738fb05fb1d Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 30 Apr 2020 11:32:48 +0200 Subject: [PATCH] Add new field to dict method. Always keep in mind to do this, when you or modify a field. --- app/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index ccb54f7e..db6d8640 100644 --- a/app/models.py +++ b/app/models.py @@ -443,8 +443,8 @@ class Corpus(db.Model): user_id = db.Column(db.Integer, db.ForeignKey('users.id')) # Fields creation_date = db.Column(db.DateTime(), default=datetime.utcnow) - last_edited_date = db.Column(db.DateTime(), default=datetime.utcnow) description = db.Column(db.String(255)) + last_edited_date = db.Column(db.DateTime(), default=datetime.utcnow) status = db.Column(db.String(16)) title = db.Column(db.String(32)) # Relationships @@ -457,6 +457,7 @@ class Corpus(db.Model): 'creation_date': self.creation_date.timestamp(), 'description': self.description, 'status': self.status, + 'last_edited_date': self.last_edited_date.timestamp(), 'title': self.title, 'files': {file.id: file.to_dict() for file in self.files}}