created WorkoutComment model
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user