summaryrefslogtreecommitdiff
path: root/workshop_app/models.py
diff options
context:
space:
mode:
authorpnshiralkar2020-05-06 16:12:42 +0530
committerpnshiralkar2020-05-06 16:12:42 +0530
commit69dde4106648aca1ac3a203b6d03501b33eead29 (patch)
tree1d08923821e9baa4712bb3f389b3b27bacdf9e28 /workshop_app/models.py
parent0fcf9d662c4768729f5d11553cc07659bd7f97a7 (diff)
downloadworkshop_booking-69dde4106648aca1ac3a203b6d03501b33eead29.tar.gz
workshop_booking-69dde4106648aca1ac3a203b6d03501b33eead29.tar.bz2
workshop_booking-69dde4106648aca1ac3a203b6d03501b33eead29.zip
Added workshop comments, linked it to workshop_status tables
Diffstat (limited to 'workshop_app/models.py')
-rw-r--r--workshop_app/models.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/workshop_app/models.py b/workshop_app/models.py
index b35d9a7..616e3de 100644
--- a/workshop_app/models.py
+++ b/workshop_app/models.py
@@ -200,26 +200,26 @@ class Testimonial(models.Model):
)
-class ProfileComments(models.Model):
+class WorkshopComment(models.Model):
"""
- Contains comments posted by instructors on coordinator profile
+ Contains comments posted by users on workshop instances
"""
- coordinator = models.ForeignKey(User,
- on_delete=models.CASCADE)
+ author = models.ForeignKey(User, on_delete=models.CASCADE)
comment = models.TextField()
- instructor = models.ForeignKey(User, related_name="%(app_label)s_%(class)s_related", on_delete=models.CASCADE)
+ public = models.BooleanField(default=True)
created_date = models.DateTimeField(default=timezone.now)
+ workshop = models.ForeignKey(Workshop, on_delete=models.CASCADE)
def __str__(self):
- return u"{0} | {1}".format(
+ return u"{0} | {1} | {2}".format(
self.comment,
self.created_date,
- self.coordinator,
- self.instructor
+ self.author,
)
+
class Banner(models.Model):
"""
Add HTML for banner display on homepage