Removed task model
This commit is contained in:
parent
90a7a8a72c
commit
31480c5c55
@ -15,24 +15,3 @@ class User(db.Model):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_editable_fields():
|
def get_editable_fields():
|
||||||
return {"username", "email", "role", "password"}
|
return {"username", "email", "role", "password"}
|
||||||
|
|
||||||
class Task(db.Model):
|
|
||||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
|
||||||
title = db.Column(db.String(100), nullable=False)
|
|
||||||
description = db.Column(db.Text)
|
|
||||||
done = db.Column(db.Boolean, default=False)
|
|
||||||
due_date = db.Column(db.DateTime)
|
|
||||||
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
|
|
||||||
|
|
||||||
def to_dict(self):
|
|
||||||
return {
|
|
||||||
"id": self.id,
|
|
||||||
"title": self.title,
|
|
||||||
"description": self.description,
|
|
||||||
"due_date": self.due_date,
|
|
||||||
"done": self.done,
|
|
||||||
}
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_editable_fields():
|
|
||||||
return {"title", "description", "due_date", "done"}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user