Commit 89d5997de2117039b58f90fd31945a22907f1fe5
Exists in
master
Merge branch 'master' of https://git.ucsd.edu/110swag/flashy-backend
Conflicts: flashy/flashcards/models.py
Showing 1 changed file Inline Diff
flashy/flashcards/models.py
View file @
89d5997
from django.db import models | 1 | 1 | from django.db import models | |
class UserFlashcard(models.Models): | 2 | 2 | class UserFlashcard(models.Models): | |
""" | 3 | 3 | """ | |
Represents the relationship between a user and a flashcard by: | 4 | 4 | Represents the relationship between a user and a flashcard by: | |
1. A user has a flashcard in their deck | 5 | 5 | 1. A user has a flashcard in their deck | |
2. A user used to have a flashcard in their deck | 6 | 6 | 2. A user used to have a flashcard in their deck | |
3. A user has a flashcard hidden from them | 7 | 7 | 3. A user has a flashcard hidden from them | |
""" | 8 | 8 | """ | |
user = models.ForeignKey(User) | 9 | 9 | user = models.ForeignKey(User) | |
mask = models.ForeignKey(FlashcardMask) | 10 | 10 | mask = models.ForeignKey(FlashcardMask) | |
flashcard = models.ForeignKey(Flashcard) | 11 | 11 | flashcard = models.ForeignKey(Flashcard) | |
pulled = models.DateTimeField('date pulled') | 12 | 12 | pulled = models.DateTimeField('date pulled') | |
unpulled = model.DateTimeField('date unpulled') | 13 | 13 | unpulled = model.DateTimeField('date unpulled') | |
14 | ||||
15 | ||||
#comment | 16 | 14 | #comment | |
17 | 15 | |||
class FlashcardMask(models.Model): | 18 | 16 | class FlashcardMask(models.Model): | |
ranges = models.CharField(max_length=255) | 19 | 17 | ranges = models.CharField(max_length=255) | |
20 | 18 | |||
class Flashcard(models.Model): | 21 | 19 | class Flashcard(models.Model): | |
text = models.CharField(max_length=255) | 22 | 20 | text = models.CharField(max_length=255) | |
class = models.ForeignKey(Class) | 23 | 21 | class = models.ForeignKey(Class) | |
pushed = models.DateTimeField() | 24 | 22 | pushed = models.DateTimeField() | |
material_date = models.DateTimeField() | 25 | 23 | material_date = models.DateTimeField() | |
previous = ForeignKey(Flashcard) | 26 | 24 | previous = ForeignKey(Flashcard) | |
author = ForeignKey(User) | 27 | 25 | author = ForeignKey(User) | |
hidden = CharField(null=True, max_length=255) | 28 | 26 | hidden = CharField(null=True, max_length=255) | |
mask = ForeignKey(FlashcardMask) | 29 | 27 | mask = ForeignKey(FlashcardMask) | |
30 | 28 | |||
class UserFlashCardReview(models.Model): | 31 | 29 | class UserFlashCardReview(models.Model): | |
user_flashcard = models.ForeignKey(UserFlashCard) | 32 | 30 | user_flashcard = models.ForeignKey(UserFlashCard) | |
when = models.DateTimeField() | 33 | 31 | when = models.DateTimeField() | |
blanked_word = models.CharField(max_length=8) | 34 | 32 | blanked_word = models.CharField(max_length=8) | |
response = models.CharField(max_length=255, blank=True, null=True) | 35 | 33 | response = models.CharField(max_length=255, blank=True, null=True) | |
correct = models.NullBooleanField() | 36 | 34 | correct = models.NullBooleanField() | |
37 | 35 | |||
class Class(models.Model): | 38 | 36 | class Class(models.Model): |