summaryrefslogtreecommitdiff
path: root/workshop_app/models.py
diff options
context:
space:
mode:
authorAkshen Doke2017-03-09 11:37:06 +0530
committerAkshen2017-05-19 15:30:31 +0530
commitf751cd3c07619d8ee1e5b96c23b19cfae2005c0f (patch)
tree21cf2c821c3d46d0e7cf917edee11a763e4f1d07 /workshop_app/models.py
parent5e4d54c0f67bf0cb6f90202997a47b914af6beb3 (diff)
downloadworkshop_booking-f751cd3c07619d8ee1e5b96c23b19cfae2005c0f.tar.gz
workshop_booking-f751cd3c07619d8ee1e5b96c23b19cfae2005c0f.tar.bz2
workshop_booking-f751cd3c07619d8ee1e5b96c23b19cfae2005c0f.zip
Instructor Creates a Workshop
The Instructor Creates a Workshop which is displayed in the /manage template irrespective of who is the Instructor
Diffstat (limited to 'workshop_app/models.py')
-rw-r--r--workshop_app/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/workshop_app/models.py b/workshop_app/models.py
index 2735069..8fe7d3a 100644
--- a/workshop_app/models.py
+++ b/workshop_app/models.py
@@ -32,7 +32,9 @@ class Profile(models.Model):
position = models.CharField(max_length=32, choices=position_choices)
def __str__(self):
- return u"{0} {1} | {2} ".format(self.user.first_name,
+ return u"id: {0}| {1} {2} | {3} ".format(
+ self.user.id,
+ self.user.first_name,
self.user.last_name,
self.user.email
)
@@ -54,7 +56,7 @@ class Workshop(models.Model):
"""Instructor Creates workshop based on
Courses available"""
- workshop_creator = models.ForeignKey(Profile, on_delete=models.CASCADE)
+ workshop_creator = models.ForeignKey(User, on_delete=models.CASCADE)
workshop_title = models.ForeignKey(Course, on_delete=models.CASCADE,\
help_text='Select the course you would like to create a workshop for')
date = models.DateField()