add: auto link feature
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime, ForeignKey, Float, text
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime, ForeignKey, Float, text, UniqueConstraint
|
||||
from db.models import Base
|
||||
import datetime
|
||||
|
||||
@@ -12,7 +12,7 @@ class Markdown(Base):
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
path_id = Column(Integer, ForeignKey('path.id'), nullable=False)
|
||||
order = Column(String(36), default=lambda: str(uuid.uuid4()))
|
||||
|
||||
shortcut = Column(String(36), default="")
|
||||
def to_dict(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
@@ -21,6 +21,7 @@ class Markdown(Base):
|
||||
'created_at': self.created_at,
|
||||
'path_id': self.path_id,
|
||||
'order': self.order,
|
||||
'shortcut': self.shortcut,
|
||||
}
|
||||
__pay_load__ = {
|
||||
'dev': [
|
||||
|
||||
Reference in New Issue
Block a user