Private
Public Access
1
0

created WorkoutComment model

This commit is contained in:
Sander Roosendaal
2017-02-17 10:27:45 +01:00
parent fd10f14660
commit 7ffaf18379
6 changed files with 233 additions and 3 deletions

View File

@@ -855,6 +855,22 @@ class RowerForm(ModelForm):
if an>=max:
raise forms.ValidationError("AN should be lower than Max")
# A comment by a user on a training
class WorkoutComment(models.Model):
created = models.DateField(default=timezone.now)
comment = models.TextField(max_length=300)
read = models.BooleanField(default=False)
user = models.ForeignKey(User)
workout = models.ForeignKey(Workout)
class WorkoutCommentForm(ModelForm):
class Meta:
model = WorkoutComment
fields = ['comment']
widgets = {
'comment': forms.Textarea,
}
# An announcement that goes to the right of the workouts list
# optionally sends a tweet to our twitter account
class SiteAnnouncement(models.Model):