add: auto link feature

This commit is contained in:
h z
2025-01-17 16:33:39 +00:00
parent 00f6895850
commit 26b64f8c15
5 changed files with 49 additions and 23 deletions

View File

@@ -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': [