manage markdowns by path
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#db/models/Markdown.py
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime, ForeignKey
|
||||
from db.models import Base
|
||||
import datetime
|
||||
|
||||
@@ -9,7 +9,7 @@ class Markdown(Base):
|
||||
title = Column(String(255), nullable=False)
|
||||
content = Column(Text, nullable=False)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
path = Column(String(255), nullable=False)
|
||||
path_id = Column(Integer, ForeignKey('path.id'), nullable=False)
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
@@ -17,5 +17,5 @@ class Markdown(Base):
|
||||
'title': self.title,
|
||||
'content': self.content,
|
||||
'created_at': self.created_at,
|
||||
'path': self.path,
|
||||
'path_id': self.path_id,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user