summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore73
-rw-r--r--workshop_app/forms.py17
-rw-r--r--workshop_app/models.py204
-rw-r--r--workshop_app/views.py2
4 files changed, 115 insertions, 181 deletions
diff --git a/.gitignore b/.gitignore
index 6aa13cc..991466f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,94 +3,26 @@ __pycache__/
*.py[cod]
*$py.class
-# C extensions
-*.so
-
# Distribution / packaging
.Python
-env/
-build/
+*.log
develop-eggs/
-dist/
-downloads/
eggs/
.eggs/
lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
*.egg-info/
.installed.cfg
*.egg
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
pip-log.txt
pip-delete-this-directory.txt
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*,cover
-.hypothesis/
-
-# Translations
-*.mo
-*.pot
-
# Django stuff:
*.log
-
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
+local_settings.py
# PyBuilder
target/
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# pyenv
-.python-version
-
-# celery beat schedule file
-celerybeat-schedule
-
-# dotenv
-.env
-
-# virtualenv
-.venv
-venv/
-ENV/
-
-# Spyder project settings
-.spyderproject
-
-# Rope project settings
-.ropeproject
-
-0
#Database
db.sqlite3
@@ -99,3 +31,4 @@ migrations/
#MAC OS specific
.DS_Store
+
diff --git a/workshop_app/forms.py b/workshop_app/forms.py
index 78b98ad..3ee457a 100644
--- a/workshop_app/forms.py
+++ b/workshop_app/forms.py
@@ -167,17 +167,18 @@ class ProposeWorkshopDateForm(forms.ModelForm):
def __init__( self, *args, **kwargs ):
kwargs.setdefault('label_suffix', '')
- super(ProposeWorkshopDateForm, self).__init__( *args, **kwargs )
- self.fields['conditionone'].label = ""
- self.fields['conditionone'].required = True
- self.fields['conditiontwo'].label = ""
- self.fields['conditiontwo'].required = True
- self.fields['conditionthree'].label = ""
- self.fields['conditionthree'].required = True
+ super(ProposeWorkshopDateForm, self).__init__(*args, **kwargs)
+ self.fields['condition_one'].label = ""
+ self.fields['condition_one'].required = True
+ self.fields['condition_two'].label = ""
+ self.fields['condition_two'].required = True
+ self.fields['condition_three'].label = ""
+ self.fields['condition_three'].required = True
class Meta:
model = ProposeWorkshopDate
- fields = ['conditionone','conditiontwo','conditionthree','proposed_workshop_title', 'proposed_workshop_date']
+ fields = ['condition_one','condition_two','condition_three',
+ 'proposed_workshop_title', 'proposed_workshop_date']
widgets = {
'proposed_workshop_date': forms.DateInput(attrs={
'class':'datepicker'}),
diff --git a/workshop_app/models.py b/workshop_app/models.py
index d709e16..8eae29e 100644
--- a/workshop_app/models.py
+++ b/workshop_app/models.py
@@ -5,138 +5,138 @@ from django.core.validators import RegexValidator
from recurrence.fields import RecurrenceField
position_choices = (
- ("coordinator", "Coordinator"),
- ("instructor", "Instructor")
- )
+ ("coordinator", "Coordinator"),
+ ("instructor", "Instructor")
+ )
def has_profile(user):
- """ check if user has profile """
- return True if hasattr(user, 'profile') else False
+ """ check if user has profile """
+ return True if hasattr(user, 'profile') else False
class Profile(models.Model):
- """Profile for users(instructors and coordinators)"""
-
- user = models.OneToOneField(User)
- institute = models.CharField(max_length=150)
- department = models.CharField(max_length=150)
- phone_number = models.CharField(
- max_length=15,
- validators=[RegexValidator(
- regex=r'^\+?1?\d{9,15}$', message=(
- "Phone number must be entered \
+ """Profile for users(instructors and coordinators)"""
+
+ user = models.OneToOneField(User)
+ institute = models.CharField(max_length=150)
+ department = models.CharField(max_length=150)
+ phone_number = models.CharField(
+ max_length=15,
+ validators=[RegexValidator(
+ regex=r'^\+?1?\d{9,15}$', message=(
+ "Phone number must be entered \
in the format: '+929490956'.\
Up to 15 digits allowed.")
- )])
- position = models.CharField(max_length=32, choices=position_choices)
- is_email_verified = models.BooleanField(default=False)
- activation_key = models.CharField(max_length=255, blank=True, null=True)
- key_expiry_time = models.DateTimeField(blank=True, null=True)
+ )])
+ position = models.CharField(max_length=32, choices=position_choices)
+ is_email_verified = models.BooleanField(default=False)
+ activation_key = models.CharField(max_length=255, blank=True, null=True)
+ key_expiry_time = models.DateTimeField(blank=True, null=True)
- def __str__(self):
- return u"id: {0}| {1} {2} | {3} ".format(
- self.user.id,
- self.user.first_name,
- self.user.last_name,
- self.user.email
- )
+ def __str__(self):
+ return u"id: {0}| {1} {2} | {3} ".format(
+ self.user.id,
+ self.user.first_name,
+ self.user.last_name,
+ self.user.email
+ )
class WorkshopType(models.Model):
- """"Admin creates types of workshops which can be used by the instructor
- to create workshops.
- """
+ """"Admin creates types of workshops which can be used by the instructor
+ to create workshops.
+ """
- workshoptype_name = models.CharField(max_length=120)
- workshoptype_description = models.TextField()
- workshoptype_duration = models.CharField(max_length=32,
- help_text='Please write this in \
- following format eg: 3days, 8hours a day')
+ workshoptype_name = models.CharField(max_length=120)
+ workshoptype_description = models.TextField()
+ workshoptype_duration = models.CharField(max_length=32,
+ help_text='Please write this in \
+ following format eg: 3days, 8hours a day')
- def __str__(self):
- return u"{0} {1}".format(self.workshoptype_name,
- self.workshoptype_duration
- )
+ def __str__(self):
+ return u"{0} {1}".format(self.workshoptype_name,
+ self.workshoptype_duration
+ )
class Workshop(models.Model):
- """Instructor Creates workshop based on
- WorkshopTypes available"""
+ """Instructor Creates workshop based on
+ WorkshopTypes available"""
- workshop_instructor = models.ForeignKey(User, on_delete=models.CASCADE)
- workshop_title = models.ForeignKey(
- WorkshopType, on_delete=models.CASCADE,
- help_text=' [Select the type of workshop.] '
- )
- #For recurring workshops source: django-recurrence
- recurrences = RecurrenceField()
+ workshop_instructor = models.ForeignKey(User, on_delete=models.CASCADE)
+ workshop_title = models.ForeignKey(
+ WorkshopType, on_delete=models.CASCADE,
+ help_text=' [Select the type of workshop.] '
+ )
+ #For recurring workshops source: django-recurrence
+ recurrences = RecurrenceField()
- def __str__(self):
- return u"{0} | {1} ".format(
- self.workshop_title,
- self.workshop_instructor
- )
+ def __str__(self):
+ return u"{0} | {1} ".format(
+ self.workshop_title,
+ self.workshop_instructor
+ )
class RequestedWorkshop(models.Model):
- """
- Contains Data of request for Workshops
- """
-
- requested_workshop_instructor = models.ForeignKey(
- User,
- on_delete=models.CASCADE
- )
- requested_workshop_coordinator = models.ForeignKey(
- User,
- related_name="%(app_label)s_%(class)s_related"
- )
- requested_workshop_date = models.DateField()
- status = models.CharField(
- max_length=32, default="Pending"
- )
- requested_workshop_title = models.ForeignKey(
- WorkshopType,
- on_delete=models.CASCADE
- )
+ """
+ Contains Data of request for Workshops
+ """
+
+ requested_workshop_instructor = models.ForeignKey(
+ User,
+ on_delete=models.CASCADE
+ )
+ requested_workshop_coordinator = models.ForeignKey(
+ User,
+ related_name="%(app_label)s_%(class)s_related"
+ )
+ requested_workshop_date = models.DateField()
+ status = models.CharField(
+ max_length=32, default="Pending"
+ )
+ requested_workshop_title = models.ForeignKey(
+ WorkshopType,
+ on_delete=models.CASCADE
+ )
class ProposeWorkshopDate(models.Model):
- """
- Contains details of proposed date and workshop from coordinator
- """
+ """
+ Contains details of proposed date and workshop from coordinator
+ """
- conditionone = models.BooleanField(default=False, help_text='I will give\
- minimum 50 participants for the workshop.')
- conditiontwo = models.BooleanField(default=False, help_text='I agree \
- that this booking won\'t be cancelled without \
- prior notice to the instructor and fossee.')
- conditionthree = models.BooleanField(default=False, help_text='This \
- proposal is subject to FOSSEE and instructor approval.')
+ condition_one = models.BooleanField(default=False, help_text='I will give\
+ minimum 50 participants for the workshop.')
+ condition_two = models.BooleanField(default=False, help_text='I agree \
+ that this booking won\'t be cancelled without \
+ prior notice to the instructor and fossee.')
+ condition_three = models.BooleanField(default=False, help_text='This \
+ proposal is subject to FOSSEE and instructor approval.')
- proposed_workshop_coordinator = models.ForeignKey(
- User,
- on_delete=models.CASCADE
- )
- proposed_workshop_instructor = models.ForeignKey(User, null=True,
- related_name="%(app_label)s_%(class)s_related")
+ proposed_workshop_coordinator = models.ForeignKey(
+ User,
+ on_delete=models.CASCADE
+ )
+ proposed_workshop_instructor = models.ForeignKey(User, null=True,
+ related_name="%(app_label)s_%(class)s_related")
- proposed_workshop_title = models.ForeignKey(
- WorkshopType, on_delete=models.CASCADE,
- help_text='Select the type of workshop.'
- )
+ proposed_workshop_title = models.ForeignKey(
+ WorkshopType, on_delete=models.CASCADE,
+ help_text='Select the type of workshop.'
+ )
- proposed_workshop_date = models.DateField()
+ proposed_workshop_date = models.DateField()
- status = models.CharField(
- max_length=32, default="Pending"
- )
+ status = models.CharField(
+ max_length=32, default="Pending"
+ )
class BookedWorkshop(models.Model):
- """
- Contains details about Confirmed Booked/Completed Workshops
- """
+ """
+ Contains details about Confirmed Booked/Completed Workshops
+ """
- booked_workshop_requested = models.ForeignKey(RequestedWorkshop, null=True)
- booked_workshop_proposed = models.ForeignKey(ProposeWorkshopDate, null=True)
+ booked_workshop_requested = models.ForeignKey(RequestedWorkshop, null=True)
+ booked_workshop_proposed = models.ForeignKey(ProposeWorkshopDate, null=True)
diff --git a/workshop_app/views.py b/workshop_app/views.py
index 270902e..0557207 100644
--- a/workshop_app/views.py
+++ b/workshop_app/views.py
@@ -27,7 +27,7 @@ from textwrap import dedent
__author__ = "Akshen Doke"
__credits__ = ["Mahesh Gudi", "Aditya P.", "Ankit Javalkar",
"Prathamesh Salunke", "Akshen Doke", "Kiran Kishore",
- "KhushalSingh Rajput"]
+ "KhushalSingh Rajput", "Prabhu Ramachandran"]
def is_email_checked(user):