Commit 437812a4 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

removed address and added campus selector

parent 97f43875
......@@ -22,7 +22,19 @@ class Building(TimeStampedModel):
neighbourhood = models.CharField(max_length=100, choices=NEIGHBOURHOOD_CHOICES,
default=NONE)
address = models.ForeignKey('Address')
#address = models.ForeignKey('Address')
PRINCE_WILLIAM = 'pw'
MASONVALE = 'mv'
FAIRFAX = 'ff'
CAMPUS_CHOICES = (
(NONE, 'None'),
(PRINCE_WILLIAM, 'Prince William'),
(MASONVALE, 'mv'),
(FAIRFAX, 'Fairfax'),
)
campus = models.CharField(max_length=100, choices=CAMPUS_CHOICES, default=NONE)
slug = AutoSlugField(populate_from='name', unique=True)
......@@ -45,18 +57,19 @@ class Room(TimeStampedModel):
def __str__(self): # __unicode__ on Python 2
return self.building.__str__()+" "+self.number.__str__()
class Address(TimeStampedModel):
# buildings on campus don't have separate addresses yet
#class Address(TimeStampedModel):
street = models.CharField(max_length=120)
city = models.CharField(max_length=120)
state = USStateField()
zip_code = models.IntegerField(max_length=5)
# street = models.CharField(max_length=120)
# city = models.CharField(max_length=120)
# state = USStateField()
# zip_code = models.IntegerField(max_length=5)
class Meta:
verbose_name_plural = 'addresses'
# class Meta:
# verbose_name_plural = 'addresses'
def __str__(self): # __unicode__ on Python 2
return self.street
# def __str__(self): # __unicode__ on Python 2
# return self.street
class Class(TimeStampedModel):
year_int = models.IntegerField()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment