Changes made to home page and started work on data_mapper, models file tweaked a bit to allow nulls in marathi fields
This commit is contained in:
parent
013af6003a
commit
78741aca7b
|
@ -6,6 +6,7 @@ import json
|
|||
import datetime
|
||||
import sys
|
||||
|
||||
def AreaLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/db_csv_files/AreaMaster.csv", "r"))
|
||||
CsvFile.next()
|
||||
for entry in CsvFile:
|
||||
|
@ -14,7 +15,9 @@ for entry in CsvFile:
|
|||
print obj.a_code, obj.areanm
|
||||
|
||||
print "----- "
|
||||
return
|
||||
|
||||
def FareLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/chaloBEST/db_csv_files/FareMaster.csv", "r"))
|
||||
test = CsvFile.next()
|
||||
print test
|
||||
|
@ -22,8 +25,9 @@ for entry in CsvFile:
|
|||
obj = Fare(slab=float(entry[0]), ordinary=int(entry[1]), limited=int(entry[2]), express=int(entry[3]), ac=int(entry[4]), ac_express=int(entry[5]))
|
||||
obj.save()
|
||||
print obj.__dict__
|
||||
return
|
||||
|
||||
|
||||
def RoadLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/db_csv_files/RoadMaster.csv", "r"))
|
||||
test = CsvFile.next()
|
||||
print test
|
||||
|
@ -31,16 +35,18 @@ for entry in CsvFile:
|
|||
obj = Road(roadcd=int(entry[0]), roadnm=str(entry[1]))
|
||||
obj.save()
|
||||
print obj.__dict__
|
||||
return
|
||||
|
||||
|
||||
def RouteLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/db_csv_files/RouteMaster.csv", "r"), delimiter='\t')
|
||||
test = CsvFile.next()
|
||||
print test
|
||||
for entry in CsvFile:
|
||||
obj = Route(route=entry[0], routealias=entry[1], from_stop=entry[2], to_stop=entry[3], distance=float(entry[4]), stages=int(entry[5]))
|
||||
print obj.__dict__
|
||||
return
|
||||
|
||||
|
||||
def RouteDetailsLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/db_csv_files/RouteDetails.csv", "r"), delimiter='\t')
|
||||
test = CsvFile.next()
|
||||
print test
|
||||
|
@ -51,9 +57,10 @@ for entry in CsvFile:
|
|||
|
||||
except:
|
||||
f.write(obj.__dict__)
|
||||
return
|
||||
#RNO,STOPSR,STOPCD,STAGE,KM
|
||||
|
||||
RNO,STOPSR,STOPCD,STAGE,KM
|
||||
|
||||
def AreaLoader():
|
||||
CsvFile = csv.reader(open("/home/johnson/Desktop/chaloBEST/chaloBEST/db_csv_files/RouteDetails.csv", "r"), delimiter='\t')
|
||||
f= open('RouteDetailsErrors', 'w')
|
||||
test = CsvFile.next()
|
||||
|
@ -96,6 +103,27 @@ for entry in CsvFile:
|
|||
print "Error:", sys.exc_info()[0]
|
||||
|
||||
f.close()
|
||||
return
|
||||
|
||||
def RouteLoader():
|
||||
CsvFile = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/Route.csv"), "r"), delimiter="\t")
|
||||
f= open(join(PROJECT_ROOT, "../db_csv_files/RouteErrors.csv"), 'w')
|
||||
header = CsvFile.next()
|
||||
print header
|
||||
for entry in CsvFile:
|
||||
try:
|
||||
obj = Route(route=entry[0], routealias=entry[1], from_stop=entry[2], to_stop=entry[3], distance=float(entry[4]), stages=int(entry[5]))
|
||||
obj.save()
|
||||
obj.__dict__
|
||||
except :
|
||||
f.write(str(sys.exc_info()[0]) + str(entry) + '\n')
|
||||
print "Error:", sys.exc_info()[0] + str(entry)
|
||||
|
||||
f.close()
|
||||
return
|
||||
|
||||
obj = Route(route=entry[0], routealias=entry[1], from_stop=entry[2], to_stop=entry[3], distance=float(entry[4]), stages=int(entry[5]))
|
||||
|
||||
|
||||
def Depot_loader():
|
||||
CsvFile = csv.reader(open(join(PROJECT_ROOT, "../db_csv_files/Depot.csv"), "r"), delimiter="\t")
|
||||
|
@ -112,7 +140,7 @@ for entry in CsvFile:
|
|||
print "Error:", sys.exc_info()[0] + str(entry)
|
||||
|
||||
f.close()
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -42,14 +42,14 @@ SCHED = {
|
|||
class Area(models.Model):
|
||||
a_code = models.IntegerField(primary_key=True)
|
||||
areanm = models.TextField(blank=True, max_length=255)
|
||||
areanm_mr= models.TextField(blank=True, max_length=512)
|
||||
areanm_mr= models.TextField(null=True, blank=True, max_length=512) #null=True,
|
||||
def __unicode__(self):
|
||||
return self.areanm
|
||||
|
||||
class Road(models.Model):
|
||||
roadcd = models.IntegerField(primary_key=True)
|
||||
roadnm = models.TextField(blank=True, max_length=255)
|
||||
#roadnm_mr= models.TextField(blank=True, max_length=512)
|
||||
roadnm_mr= models.TextField(null=True, blank=True, max_length=512)
|
||||
def __unicode__(self):
|
||||
return self.roadnm
|
||||
|
||||
|
@ -74,7 +74,7 @@ class Stop(models.Model):
|
|||
roadcd = models.ForeignKey(Road)
|
||||
a_code = models.ForeignKey(Area)
|
||||
depot = models.TextField(max_length=255) # should actually be a foreign key to a depotMaster,
|
||||
stopnm_mr= models.TextField(blank=True, max_length=512)
|
||||
stopnm_mr= models.TextField(null=True, blank=True, max_length=512)#null=True,
|
||||
|
||||
def __unicode__(self):
|
||||
return self.stopnm
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<title>ChaloBEST</title>
|
||||
|
||||
</head>
|
||||
<body bgcolor="#000000">
|
||||
<body link="white" vlink="white" alink="white">
|
||||
|
||||
<font color="white">
|
||||
|
@ -14,17 +13,26 @@
|
|||
<div>
|
||||
<img src="/static/images/logo.png">
|
||||
</div>
|
||||
<div>
|
||||
<h3>Free and simple tools to find bus routes in Mumbai, coming soon to your phone.</h3>
|
||||
<h3>Try out our <a href="http://m.chalobest.in">mobile website</a>, <a href="http://sms.chalobest.in">SMS service</a>, and <a href="http://droid.chalobest.in">Android application</a>.</h3>
|
||||
<br><br>
|
||||
<p>Want to get involved or learn more? Check out our <a href="http://wiki.chalobest.in">project wiki</a> or join our <a href="http://gnowledge.org/cgi-bin/mailman/listinfo/smsbest">mailing list</a>.
|
||||
<br>
|
||||
<p><a href="http://chalobest.in">ChaloBEST</a> is a collaboration of <a href="http://mesn.org">Mumbai Environmental Social Network (MESN)</a>, <a href="http://sparcsys.com">SPARC Systems</a>, <a href="http://camputer.org">CAMP</a>, and <br> <a href="http://www.hbcse.tifr.res.in">Homi Bhabha Centre for Science Education, TIFR</a>, with support from <a href="http://bestundertaking.com">BEST (Brihanmumbai Electric Supply & Transport Undertaking)</a>.</p>
|
||||
|
||||
<div>
|
||||
<h3>Free and simple tools to find your way through Mumbai, coming soon to SMS, web and smartphone.</h3>
|
||||
|
||||
<p>Want to get involved or learn more? Check out our <a href="http://wiki.chalobest.in/">project wiki</a> or join our <a href="http://gnowledge.org/cgi-bin/mailman/listinfo/smsbest">mailing list</a>.
|
||||
<br>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://chalobest.in/">ChaloBEST</a> is a collaboration of <a href="http://camputer.org/">CAMP</a>, <a href="http://mgtech.in/">MacGregor TechKnowlogy</a>, <a href="http://sparcsys.com/">SPARC Systems</a>, <a href="http://userinnov.com/">UserINNOV</a>, and the<br> <a href="http://www.hbcse.tifr.res.in/">Homi Bhabha Centre for Science Education, Tata Institute of Fundamental Research (TIFR)</a>.
|
||||
</p>
|
||||
<p>
|
||||
We are funded by the <a href="http://iihs.ac.in/">Indian Institute of Human Settlements</a> as the first-prize winners in the <br> <a href="http://transformurbanindia.com/">Sankranti Transform Urban India</a> competition at the <a href="http://iuc2011.in">India Urban Conference 2011</a>.
|
||||
</p>
|
||||
|
||||
<p>We are also supported by the Traffic Planning Department of the <a href="http://bestundertaking.com/">BEST (Brihanmumbai Electric Supply & Transport Undertaking)</a>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</center>
|
||||
</font>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user