diff options
author | Akshen Doke | 2017-03-30 10:54:05 +0530 |
---|---|---|
committer | Akshen | 2017-05-19 15:30:31 +0530 |
commit | 55585b6864e128dfd4fae5ae391373abf96c5ce5 (patch) | |
tree | 4fe8d974fd3ffd35246c1c16a192eb6b82db5d23 /workshop_app/models.py | |
parent | f751cd3c07619d8ee1e5b96c23b19cfae2005c0f (diff) | |
download | workshop_booking-55585b6864e128dfd4fae5ae391373abf96c5ce5.tar.gz workshop_booking-55585b6864e128dfd4fae5ae391373abf96c5ce5.tar.bz2 workshop_booking-55585b6864e128dfd4fae5ae391373abf96c5ce5.zip |
Recurrence done
Booking ToDo
Diffstat (limited to 'workshop_app/models.py')
-rw-r--r-- | workshop_app/models.py | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/workshop_app/models.py b/workshop_app/models.py index 8fe7d3a..a16c6a3 100644 --- a/workshop_app/models.py +++ b/workshop_app/models.py @@ -2,14 +2,17 @@ from django.db import models from django.contrib.auth.models import User from django.core.validators import RegexValidator - +from recurrence.fields import RecurrenceField position_choices = ( ("coordinator", "Coordinator"), ("instructor", "Instructor") ) - +status_choices = ( + ("pending", "Pending"), + ("confirm", "Confirm") + ) def has_profile(user): """ check if user has profile """ @@ -41,7 +44,8 @@ class Profile(models.Model): class Course(models.Model): - """"Admin creates courses which can be used by the instructor to create workshops. + """"Admin creates courses which can be used by the instructor + to create workshops. """ course_name = models.CharField(max_length=120) @@ -56,13 +60,29 @@ class Workshop(models.Model): """Instructor Creates workshop based on Courses available""" - 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() - start_time = models.TimeField() - end_time = models.TimeField() + workshop_instructor = 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' + ) + + recurrences = RecurrenceField() #status = models.BooleanField() Book, Pending, Booked def __str__(self): - return u"{0} | {1}".format(self.workshop_title, self.date) + return u"{0} | {1} ".format(self.workshop_title, self.workshop_instructor) + + +# class completed_Workshop(models.Model): +# """ +# Contains Data of Booked/Completed Workshops +# """ + +# workshop_instructor = models.ForeignKey(User, on_delete=models.CASCADE) +# workshop_coordinator = models.ForeignKey(User) +# status = models.CharField(max_length=32, choices=status_choices) +# workshop_title = models.ForeignKey(Course, on_delete=models.CASCADE) + + + |