Skip to content

Commit

Permalink
feat: make flashcard serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Apr 4, 2024
1 parent 6e9837c commit 4db4798
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/flashcards/text_to_flashcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Flashcard:
front: str
back: str

def to_dict(self):
return {"front": self.front, "back": self.back}


def parse_flashcard(flashcards_data: list[str]) -> list[Flashcard]:
"""
Returns a list of the Flashcard dataclass
Expand Down

0 comments on commit 4db4798

Please sign in to comment.