import atlas silly error

This commit is contained in:
Sanj 2012-02-17 13:34:28 +05:30
parent 27e0d591fa
commit eb17261df0

View File

@ -19,6 +19,9 @@ def csvToJSON():
routeNo = a[1].strip() routeNo = a[1].strip()
# print a # print a
if routeNo != '': if routeNo != '':
if atlasDict.has_key(routeNo):
atlasDist[routeNo].append(a)
else:
atlasDict[routeNo] = [a] atlasDict[routeNo] = [a]
previousRoute = routeNo previousRoute = routeNo
else: else:
@ -58,7 +61,7 @@ def processJSON():
row[i] = previousRow[i] row[i] = previousRow[i]
try: try:
if row[-5].strip() == '': if row[-5].strip() == '':
row[-5] = previousRow[-5] row[-5] = previousRow[-5] #What is -5 ?
except: except:
pdb.set_trace() pdb.set_trace()
previousRow = row previousRow = row
@ -238,8 +241,8 @@ def noneInt(val):
''' '''
Passed a route code, it gets stop codes for the first and last stop Passed a route code, it gets stop codes for the first and last stop
''' '''
def getFromToStopsForRoute(routeId): def getFromToStopsForRoute(route):
routeDetails = RouteDetail.objects.filter(route_code=routeId).order_by('serial') routeDetails = RouteDetail.objects.filter(route=route).order_by('serial')
if routeDetails.count() == 0: if routeDetails.count() == 0:
return None return None
fromStop = routeDetails[0].stop fromStop = routeDetails[0].stop