mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44: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'))
|
||||
# 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}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user