added download button to slides with pdfs
This commit is contained in:
@@ -71,6 +71,7 @@ class Deck(db.Model):
|
||||
deck : Mapped[str] = mapped_column(String(60), nullable=False)
|
||||
description : Mapped[str] = mapped_column(String(60))
|
||||
index_file: Mapped[str] = mapped_column(String(40), nullable=False)
|
||||
export_file: Mapped[Optional[str]] = mapped_column(String(40), nullable=True)
|
||||
|
||||
passwords : Mapped[List[Password]] = relationship("Password", secondary=deck_password, back_populates='decks')
|
||||
tokens : Mapped[List[Token]] = relationship("Token", secondary=deck_token, back_populates='decks')
|
||||
@@ -78,12 +79,14 @@ class Deck(db.Model):
|
||||
course: Mapped['Course'] = relationship("Course", back_populates='decks')
|
||||
|
||||
|
||||
def __init__(self, name: str, deck: str, course: Course, description: str = "", index_file: str = "index.html") -> None:
|
||||
def __init__(self, name: str, deck: str, course: Course, description: str = "", index_file: str = "index.html", export_file: str | None = None) -> None:
|
||||
self.name = name
|
||||
self.deck = deck
|
||||
self.description = description
|
||||
self.course = course
|
||||
self.index_file = index_file
|
||||
if export_file:
|
||||
self.export_file = export_file
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<Deck(name={self.name}, deck={self.deck}, course={self.course}, index={self.index_file})>"
|
||||
|
||||
Reference in New Issue
Block a user