schema for atlas import added to models.py
This commit is contained in:
parent
00d51e0d78
commit
86928205c1
|
@ -19,12 +19,7 @@ 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 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
|
|
||||||
|
|
|
@ -108,6 +108,41 @@ class Route(models.Model):
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.route
|
return self.route
|
||||||
|
|
||||||
|
class UniqueRoute(models.Model):
|
||||||
|
route = models.ForeignKey(Route)
|
||||||
|
from_stop = models.ForeignKey(Stop, related_name="routes_from")
|
||||||
|
to_stop = models.ForeignKey(Stop, related_name="routes_to")
|
||||||
|
distance = models.DecimalField(max_digits=3, decimal_places=2)
|
||||||
|
is_full = models.BooleanField()
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return "%s: %s to %s" % (self.route.routealias, self.from_stop, self.to_stop,)
|
||||||
|
|
||||||
|
class RouteSchedule(models.Model):
|
||||||
|
unique_route = models.ForeignKey(UniqueRoute)
|
||||||
|
schedule_type = models.CharField(max_length=16)
|
||||||
|
busesAM = models.IntegerField(blank=True, null=True)
|
||||||
|
busesN = models.IntegerField(blank=True, null=True)
|
||||||
|
busesPM = models.IntegerField(blank=True, null=True)
|
||||||
|
bus_type = models.CharField(max_length=3, default="SD")
|
||||||
|
depot = models.ForeignKey("Depot")
|
||||||
|
first_from = models.TimeField(blank=True, null=True)
|
||||||
|
last_from = models.TimeField(blank=True, null=True)
|
||||||
|
first_to = models.TimeField(blank=True, null=True)
|
||||||
|
last_to = models.TimeField(blank=True, null=True)
|
||||||
|
runtime1 = models.IntegerField(blank=True, null=True)
|
||||||
|
runtime2 = models.IntegerField(blank=True, null=True)
|
||||||
|
runtime3 = models.IntegerField(blank=True, null=True)
|
||||||
|
runtime4 = models.IntegerField(blank=True, null=True)
|
||||||
|
headway1 = models.IntegerField(blank=True, null=True)
|
||||||
|
headway2 = models.IntegerField(blank=True, null=True)
|
||||||
|
headway3 = models.IntegerField(blank=True, null=True)
|
||||||
|
headway4 = models.IntegerField(blank=True, null=True)
|
||||||
|
headway5 = models.IntegerField(blank=True, null=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return "%s: %s" % (unicode(self.unique_route), self.schedule_type,)
|
||||||
|
|
||||||
class RouteTypes(models.Model):
|
class RouteTypes(models.Model):
|
||||||
routecode = models.TextField(max_length=50)
|
routecode = models.TextField(max_length=50)
|
||||||
routetype = models.TextField(max_length=50)
|
routetype = models.TextField(max_length=50)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user