cleaned up models file in new_best/models.py

This commit is contained in:
Sanj 2011-10-01 16:37:03 +05:30
parent f042101661
commit ac4ffa059f
3 changed files with 89 additions and 78 deletions

View File

@ -1,31 +1,73 @@
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
# into your database.
from django.contrib.gis.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
class Acexpressroutes(models.Model):
routecode = models.CharField(max_length=512)
stopserial = models.IntegerField()
stageno = models.IntegerField()
stopcode = models.ForeignKey('Stopmaster', db_column='stopcode')
stage = models.CharField(max_length=512)
km = models.FloatField()
LANGUAGE_CHOICES = (
('en', 'English'),
('ma', 'Marathi'),
('hi', 'Hindi'),
)
ALTERNATIVE_NAME_TYPES = (
('colloquial', 'Colloquial'),
('official', 'Official'),
('historical', 'Historical'),
('other', 'Other'),
)
DIRECTION_CHOICES = (
('up', 'Up'),
('down', 'Down'),
('ring', 'Ring'),
)
class Stop(models.Model):
stopcode = models.IntegerField(unique=True, db_index=True)
stopname = models.CharField(max_length=512)
class Meta:
db_table = u'acexpressroutes'
areacode = models.ForeignKey('Area')
displayname = models.CharField(max_length=512)
smlength = models.IntegerField()
def __unicode__(self):
return self.routecode
return self.stopname
class AlternativeName(models.Model):
name = models.CharField(max_length=255)
language = models.CharField(max_length=10, choices=LANGUAGE_CHOICES)
typ = models.CharField(max_length=64, choices=ALTERNATIVE_NAME_TYPES)
priority = models.IntegerField(default=0)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
def __unicode__(self):
return self.name
class PhysicalStop(models.Model):
point = models.PointField(blank=True)
stop = models.ForeignKey(Stop)
direction = models.CharField(choices=DIRECTION_CHOICES, max_length=16)
def __unicode__(self):
return self.stop.displayname
class Area(models.Model):
areacode = models.IntegerField(unique=True, db_index=True)
areaname = models.CharField(max_length=512)
polygon = models.PolygonField(blank=True)
def __unicode__(self):
return self.areaname
class Atlas(models.Model):
routecode = models.CharField(max_length=512)
routecode = models.CharField(max_length=512, db_index=True)
route = models.CharField(max_length=512)
busfrom = models.CharField(max_length=512)
firstfrom = models.CharField(max_length=512)
@ -46,85 +88,51 @@ class Atlas(models.Model):
reliefpoint = models.CharField(max_length=512)
traveltime = models.CharField(max_length=512)
scheduletype = models.CharField(max_length=512)
id = models.IntegerField(unique=True, primary_key=True)
class Meta:
db_table = u'atlas'
def __unicode__(self):
return self.route
class Regularroutes(models.Model):
routecode = models.CharField(max_length=512)
stopserial = models.IntegerField()
stageno = models.IntegerField()
stopcode = models.ForeignKey('Stopmaster', db_column='stopcode')
stage = models.CharField(max_length=512)
km = models.FloatField()
stopname = models.CharField(max_length=512)
class Meta:
db_table = u'regularroutes'
def __unicode__(self):
return self.routecode
class Routetype(models.Model):
class RouteType(models.Model):
typenumber = models.IntegerField()
routetype = models.CharField(max_length=512)
class Meta:
db_table = u'routetype'
def __unicode__(self):
return self.routetype
class Stopmaster(models.Model):
stopcode = models.IntegerField(unique=True, primary_key=True)
stopname = models.CharField(max_length=512)
areacode = models.ForeignKey('Areamaster', db_column='areacode')
displayname = models.CharField(max_length=512)
smlength = models.IntegerField()
class Meta:
db_table = u'stopmaster'
def __unicode__(self):
return self.stopname
class Areamaster(models.Model):
areacode = models.IntegerField(unique=True, primary_key=True)
areaname = models.CharField(max_length=512)
class Meta:
db_table = u'areamaster'
def __unicode__(self):
return self.areaname
class Asroutes(models.Model):
class Route(models.Model):
routecode = models.CharField(max_length=512)
stopserial = models.IntegerField()
stageno = models.IntegerField()
stopcode = models.ForeignKey('Stopmaster', db_column='stopcode')
stopcode = models.ForeignKey('Stop')
physical_stop = models.ForeignKey('PhysicalStop')
stage = models.CharField(max_length=512)
km = models.FloatField()
stopname = models.CharField(max_length=512)
class Meta:
db_table = u'asroutes'
abstract = True
def __unicode__(self):
return self.routecode
class Expressroutes(models.Model):
routecode = models.CharField(max_length=512)
stopserial = models.IntegerField()
stageno = models.IntegerField()
stopcode = models.ForeignKey('Stopmaster', db_column='stopcode')
stage = models.CharField(max_length=512)
km = models.FloatField()
stopname = models.CharField(max_length=512)
class Meta:
db_table = u'expressroutes'
class RegularRoute(Route):
pass
def __unicode__(self):
return self.routecode
class AcExpressRoute(Route):
pass
class AsRoute(Route):
pass
class Expressroutes(Route):
pass
'''
class LocationsPoint(models.Model):
id = models.IntegerField(primary_key=True)
latitude = models.DecimalField(max_digits=13, decimal_places=10)
@ -155,3 +163,4 @@ class LocationsLocation(models.Model):
def __unicode__(self):
return str(self.id)
'''

View File

@ -91,7 +91,9 @@ background: linear-gradient(top, #94997e 0%,#d2dab3 10%,#d2dab3 80%,#94997e 100%
#header #auth a {
color: #CE0000;
padding-right:6px;
font-size:80%;}
font-size:80%;
}
#branding {