mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
Add new field to dict method. Always keep in mind to do this, when you or modify a field.
This commit is contained in:
parent
f87fe589c1
commit
08b909b9a8
@ -443,8 +443,8 @@ class Corpus(db.Model):
|
|||||||
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
|
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
|
||||||
# Fields
|
# Fields
|
||||||
creation_date = db.Column(db.DateTime(), default=datetime.utcnow)
|
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))
|
description = db.Column(db.String(255))
|
||||||
|
last_edited_date = db.Column(db.DateTime(), default=datetime.utcnow)
|
||||||
status = db.Column(db.String(16))
|
status = db.Column(db.String(16))
|
||||||
title = db.Column(db.String(32))
|
title = db.Column(db.String(32))
|
||||||
# Relationships
|
# Relationships
|
||||||
@ -457,6 +457,7 @@ class Corpus(db.Model):
|
|||||||
'creation_date': self.creation_date.timestamp(),
|
'creation_date': self.creation_date.timestamp(),
|
||||||
'description': self.description,
|
'description': self.description,
|
||||||
'status': self.status,
|
'status': self.status,
|
||||||
|
'last_edited_date': self.last_edited_date.timestamp(),
|
||||||
'title': self.title,
|
'title': self.title,
|
||||||
'files': {file.id: file.to_dict() for file in self.files}}
|
'files': {file.id: file.to_dict() for file in self.files}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user