project/scipycon/registration/models.py
changeset 101 61fc4aa7a09a
parent 94 87e77aa18610
child 104 1a83a26756c3
--- a/project/scipycon/registration/models.py	Wed Jul 14 19:17:31 2010 +0530
+++ b/project/scipycon/registration/models.py	Wed Jul 14 19:34:12 2010 +0530
@@ -1,16 +1,15 @@
-# -*- coding: utf-8 -*-
-from __future__ import absolute_import
-
-#django
 from django.db import models
 from django.contrib.auth.models import User
 
+from project.scipycon.base import models as base_models
+
 from .utils import send_confirmation_payment_email
 from .utils import send_banking_fix_email
 
 from .labels import WIFI_CHOICES
 from .labels import WIFI_HELP
 
+
 SIZE_CHOICES = (
     ('S', 'S'),
     ('M', 'M'),
@@ -18,51 +17,52 @@
     ('XL', 'XL'),
     )
 
-class Wifi(models.Model):
+
+class Wifi(base_models.Base):
     """Defines wifi options at *PyCon"""
     user = models.ForeignKey(User)
     wifi = models.CharField(max_length=50, choices=WIFI_CHOICES,
             help_text=WIFI_HELP, verbose_name="Laptop")
 
-class Registration(models.Model):
-    """Defines registration at *PyCon"""
+
+class Registration(base_models.Model):
+    """Defines registration at SciPy.in"""
+
     slug = models.SlugField()
+
     registrant = models.ForeignKey(User)
+
     organisation = models.CharField(max_length=255, blank=True)
+
     occupation = models.CharField(max_length=255, blank=True)
+
     city = models.CharField(max_length=255, blank=True)
+
     postcode = models.CharField(max_length=255, blank=True)
-#    beverage = models.CharField(max_length=255, blank=True)
-#    diet = models.CharField(max_length=255, blank=True)
-#    sponsor = models.CharField(max_length=255, blank=True)
+    
+    phone_num = models.CharField(max_length=14, blank=True)
+
     tshirt = models.CharField(max_length=2, choices=SIZE_CHOICES)
-#    party = models.BooleanField(default=False)
-#    discount = models.BooleanField(default=False)
+
+    conference = models.BooleanField(default=False)
 
-    # scipy.in specific
-    conference = models.BooleanField(default=False)
-    # scipy.in specific
     tutorial = models.BooleanField(default=False)
-    # scipy.in specific
+
     sprint = models.BooleanField(default=False)
 
-#    amount = models.IntegerField(default=0)
+    final_conference = models.BooleanField(default=False)
+
+    final_tutorial = models.BooleanField(default=False)
+
+    final_sprint = models.BooleanField(default=False)
+
     allow_contact = models.BooleanField(default=False)
-#    payment = models.BooleanField(default=False)
+
     submitted = models.DateTimeField(auto_now_add=True)
+
     last_mod = models.DateTimeField(auto_now=True)
 
     def __unicode__(self):
-        return 'Registration for user: <%s %s> %s' % (self.registrant.first_name,
-                self.registrant.last_name, self.registrant.email)
-
-#    def save(self, *args, **kwargs):
-#        if(self.id):
-#            old_reg = Registration.objects.get(pk=self.id)
-#            if(old_reg.payment == False and self.payment == True \
-#                    and not self.sponsor):
-#                send_confirmation_payment_email(self.registrant)
-#            if(old_reg.slug.startswith('NZ') and self.slug.startswith('KPC') \
-#                    and not self.sponsor):
-#                send_banking_fix_email(self.registrant, self.slug)
-#        super(Registration, self).save(args, kwargs)
+        return 'Registration for user: <%s %s> %s' % (
+            self.registrant.first_name,
+            self.registrant.last_name, self.registrant.email)