Commit e417ad41 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

changed state field from charfield to USStateField

parent e426786f
from django.db import models
from autoslug import AutoSlugField
from model_utils.models import TimeStampedModel
from django.contrib.auth.models import User
from localflavor.us.models import USStateField
class Building(TimeStampedModel):
name = models.CharField(max_length=100)
......@@ -44,11 +45,10 @@ class Room(TimeStampedModel):
def __str__(self): # __unicode__ on Python 2
return self.building.__str__()+" "+self.number.__str__()
class Address(TimeStampedModel):
street = models.CharField(max_length=100)
zip_code = models.IntegerField(max_length=5)
state = models.CharField(max_length=2)
state = USStateField()
class Meta:
verbose_name_plural = 'addresses'
......@@ -56,7 +56,6 @@ class Address(TimeStampedModel):
def __str__(self): # __unicode__ on Python 2
return self.street
class Class(TimeStampedModel):
year_int = models.IntegerField()
FRESHMAN = 'FR'
......@@ -75,6 +74,5 @@ class Class(TimeStampedModel):
class Meta:
verbose_name_plural = 'classes'
def __str__(self): # __unicode__ on Python 2
return str(self.year_int)
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