added subroute models

This commit is contained in:
Sanj 2011-12-16 19:59:06 +05:30
parent 56ee058e83
commit 689df93f8a
3 changed files with 26 additions and 9 deletions

View File

@ -19,8 +19,6 @@ def csvToJSON():
jsonFile = open(join(PROJECT_ROOT, "../db_csv_files/Atlas.json"), "w") jsonFile = open(join(PROJECT_ROOT, "../db_csv_files/Atlas.json"), "w")
jsonFile.write(json.dumps(atlasDict, indent=2)) jsonFile.write(json.dumps(atlasDict, indent=2))
jsonFile.close() jsonFile.close()
<<<<<<< TREE
def getRouteCodes(): def getRouteCodes():
atlasRawCSV = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/AtlasRaw.csv"), "r"), delimiter="\t") atlasRawCSV = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/AtlasRaw.csv"), "r"), delimiter="\t")
@ -40,14 +38,7 @@ def getRouteCodes():
mappingFile.write(json.dumps(mapping, indent=2)) mappingFile.write(json.dumps(mapping, indent=2))
mappingFile.close() mappingFile.close()
=======
<<<<<<< TREE
def csvClean1(): def csvClean1():
atlasCSV = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/Atlas.csv"), "r"), delimiter="\t") atlasCSV = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/Atlas.csv"), "r"), delimiter="\t")
=======
>>>>>>> MERGE-SOURCE
>>>>>>> MERGE-SOURCE

View File

@ -52,6 +52,32 @@ class RouteDetails(models.Model):
return self.rno return self.rno
class SubRoute(models.Model):
from_stop = models.ForeignKey(Stop, related_name="subroutes_from")
to_stop = models.ForeignKey(Stop, related_name="subroutes_to")
route = models.ForeignKey("Route")
is_longest = models.BooleanField()
span = models.FloatField()
class SubrouteSchedule(models.Model):
subroute = models.ForeignKey(SubRoute)
schedule_type = models.ForeignKey("ScheduleType")
first_from = models.FloatField(null=True, blank=True)
last_from = models.FloatField(null=True, blank=True)
first_to = models.FloatField(null=True, blank=True)
last_to = models.FloatField(null=True, blank=True)
headway07 = models.IntegerField(null=True, blank=True)
headway711 = models.IntegerField(null=True, blank=True)
headway1117 = models.IntegerField(null=True, blank=True)
headway1720 = models.IntegerField(null=True, blank=True)
headway20 = models.IntegerField(null=True, blank=True)
class ScheduleType(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return self.name
class Route(models.Model): class Route(models.Model):
route = models.TextField(max_length=255) route = models.TextField(max_length=255)