Renamed Base Model with scope and propogated it to other models.
--- a/project/scipycon/base/models.py Thu Jul 15 00:50:16 2010 +0530
+++ b/project/scipycon/base/models.py Thu Jul 15 00:50:38 2010 +0530
@@ -1,8 +1,11 @@
from django.db import models
-class Base(models.Model):
+class ScopedBase(models.Model):
"""Base model which is in turn inherited by other models.
"""
-
+
scope = models.CharField(max_length=255)
+
+ class Meta:
+ abstract = True
--- a/project/scipycon/proceedings/models.py Thu Jul 15 00:50:16 2010 +0530
+++ b/project/scipycon/proceedings/models.py Thu Jul 15 00:50:38 2010 +0530
@@ -4,7 +4,7 @@
from project.scipycon.base import models as base_models
-class Paper(base_models.Base):
+class Paper(base_models.ScopedBase):
"""Data model for storing proceedings paper.
"""
@@ -21,7 +21,7 @@
authors = models.ManyToManyField(User)
-class Attachments(models.Base):
+class Attachments(models.Model):
"""Stores attachments for papers.
"""
--- a/project/scipycon/registration/models.py Thu Jul 15 00:50:16 2010 +0530
+++ b/project/scipycon/registration/models.py Thu Jul 15 00:50:38 2010 +0530
@@ -18,14 +18,16 @@
)
-class Wifi(base_models.Base):
- """Defines wifi options at *PyCon"""
+class Wifi(base_models.ScopedBase):
+ """Defines wifi options at SciPy.in
+ """
user = models.ForeignKey(User)
+
wifi = models.CharField(max_length=50, choices=WIFI_CHOICES,
- help_text=WIFI_HELP, verbose_name="Laptop")
+ help_text=WIFI_HELP, verbose_name="Laptop")
-class Registration(base_models.Model):
+class Registration(base_models.ScopedBase):
"""Defines registration at SciPy.in"""
slug = models.SlugField()
@@ -39,7 +41,7 @@
city = models.CharField(max_length=255, blank=True)
postcode = 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)
--- a/project/scipycon/talk/models.py Thu Jul 15 00:50:16 2010 +0530
+++ b/project/scipycon/talk/models.py Thu Jul 15 00:50:38 2010 +0530
@@ -22,7 +22,7 @@
)
-class Talk(base_models.Base):
+class Talk(base_models.ScopedBase):
"""Defines talks at SciPy.in
"""
--- a/project/scipycon/user/models.py Thu Jul 15 00:50:16 2010 +0530
+++ b/project/scipycon/user/models.py Thu Jul 15 00:50:38 2010 +0530
@@ -6,7 +6,7 @@
from project.scipycon.base import models as base_models
-class UserProfile(base_models.Base):
+class UserProfile(base_models.ScopedBase):
"""Extend atributes for django User
"""