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. from django.contrib.gis.db import models
# You'll have to do the following manually to clean this up: from django.contrib.contenttypes.models import ContentType
# * Rearrange models' order from django.contrib.contenttypes import generic
# * 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.db import models
class Acexpressroutes(models.Model): LANGUAGE_CHOICES = (
routecode = models.CharField(max_length=512) ('en', 'English'),
stopserial = models.IntegerField() ('ma', 'Marathi'),
stageno = models.IntegerField() ('hi', 'Hindi'),
stopcode = models.ForeignKey('Stopmaster', db_column='stopcode') )
stage = models.CharField(max_length=512)
km = models.FloatField() 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) stopname = models.CharField(max_length=512)
class Meta: areacode = models.ForeignKey('Area')
db_table = u'acexpressroutes' displayname = models.CharField(max_length=512)
smlength = models.IntegerField()
def __unicode__(self): 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): 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) route = models.CharField(max_length=512)
busfrom = models.CharField(max_length=512) busfrom = models.CharField(max_length=512)
firstfrom = 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) reliefpoint = models.CharField(max_length=512)
traveltime = models.CharField(max_length=512) traveltime = models.CharField(max_length=512)
scheduletype = 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): def __unicode__(self):
return self.route 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): class RouteType(models.Model):
return self.routecode
class Routetype(models.Model):
typenumber = models.IntegerField() typenumber = models.IntegerField()
routetype = models.CharField(max_length=512) routetype = models.CharField(max_length=512)
class Meta:
db_table = u'routetype'
def __unicode__(self): def __unicode__(self):
return self.routetype 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): class Route(models.Model):
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):
routecode = models.CharField(max_length=512) routecode = models.CharField(max_length=512)
stopserial = models.IntegerField() stopserial = models.IntegerField()
stageno = 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) stage = models.CharField(max_length=512)
km = models.FloatField() km = models.FloatField()
stopname = models.CharField(max_length=512) stopname = models.CharField(max_length=512)
class Meta: class Meta:
db_table = u'asroutes' abstract = True
def __unicode__(self): def __unicode__(self):
return self.routecode return self.routecode
class Expressroutes(models.Model): class RegularRoute(Route):
routecode = models.CharField(max_length=512) pass
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'
def __unicode__(self): class AcExpressRoute(Route):
return self.routecode pass
class AsRoute(Route):
pass
class Expressroutes(Route):
pass
'''
class LocationsPoint(models.Model): class LocationsPoint(models.Model):
id = models.IntegerField(primary_key=True) id = models.IntegerField(primary_key=True)
latitude = models.DecimalField(max_digits=13, decimal_places=10) latitude = models.DecimalField(max_digits=13, decimal_places=10)
@ -155,3 +163,4 @@ class LocationsLocation(models.Model):
def __unicode__(self): def __unicode__(self):
return str(self.id) return str(self.id)
'''

View File

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

View File

@ -13,7 +13,7 @@ table {
col.sorted { col.sorted {
background: #fcfcff; } background: #fcfcff; }
tr { } tr{ }
td, th { td, th {
padding: 0.5em; padding: 0.5em;