158 lines
5.3 KiB
Python
158 lines
5.3 KiB
Python
# 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.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()
|
|
stopname = models.CharField(max_length=512)
|
|
class Meta:
|
|
db_table = u'acexpressroutes'
|
|
|
|
def __unicode__(self):
|
|
return self.routecode
|
|
|
|
|
|
class Atlas(models.Model):
|
|
routecode = models.CharField(max_length=512)
|
|
route = models.CharField(max_length=512)
|
|
busfrom = models.CharField(max_length=512)
|
|
firstfrom = models.CharField(max_length=512)
|
|
lastfrom = models.CharField(max_length=512)
|
|
busto = models.CharField(max_length=512)
|
|
firstto = models.CharField(max_length=512)
|
|
lastto = models.CharField(max_length=512)
|
|
routespan = models.CharField(max_length=512)
|
|
runtime7to11 = models.CharField(max_length=512)
|
|
runtime11to17 = models.CharField(max_length=512)
|
|
runtime17toend = models.CharField(max_length=512)
|
|
runtimenight = models.CharField(max_length=512)
|
|
headwaybefore7 = models.CharField(max_length=512)
|
|
headway7to11 = models.CharField(max_length=512)
|
|
headway11to17 = models.CharField(max_length=512)
|
|
headway17to20 = models.CharField(max_length=512)
|
|
headway20tolast = models.CharField(max_length=512)
|
|
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):
|
|
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):
|
|
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'asroutes'
|
|
|
|
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'
|
|
|
|
def __unicode__(self):
|
|
return self.routecode
|
|
|
|
class LocationsPoint(models.Model):
|
|
id = models.IntegerField(primary_key=True)
|
|
latitude = models.DecimalField(max_digits=13, decimal_places=10)
|
|
longitude = models.DecimalField(max_digits=13, decimal_places=10)
|
|
class Meta:
|
|
db_table = u'locations_point'
|
|
|
|
def __unicode__(self):
|
|
return str(self.id)
|
|
|
|
class LocationsLocationtype(models.Model):
|
|
name = models.CharField(max_length=100)
|
|
slug = models.CharField(max_length=50, primary_key=True)
|
|
class Meta:
|
|
db_table = u'locations_locationtype'
|
|
|
|
def __unicode__(self):
|
|
return self.name
|
|
|
|
class LocationsLocation(models.Model):
|
|
id = models.IntegerField(primary_key=True)
|
|
point = models.ForeignKey(LocationsPoint)
|
|
type = models.ForeignKey(LocationsLocationtype)
|
|
# parent_type = models.ForeignKey(DjangoContentType)
|
|
parent_id = models.IntegerField()
|
|
class Meta:
|
|
db_table = u'locations_location'
|
|
|
|
def __unicode__(self):
|
|
return str(self.id)
|