Subversion Repositories SmartDukaan

Rev

Rev 17498 | Rev 17556 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17498 Rev 17499
Line 1438... Line 1438...
1438
    def on_get(self,req,resp,pincode):
1438
    def on_get(self,req,resp,pincode):
1439
        json_data={}
1439
        json_data={}
1440
        cities=[]
1440
        cities=[]
1441
        print pincode
1441
        print pincode
1442
        if len(str(pincode)) ==6:
1442
        if len(str(pincode)) ==6:
1443
            listCities = list(session.query(Postoffices.taluk,Postoffices.state).distinct(Postoffices.taluk,Postoffices.state).filter(Postoffices.pincode==pincode).filter(Postoffices.taluk!='NA').all())
1443
            listCities = list(session.query(Postoffices.taluk,Postoffices.state).distinct().filter(Postoffices.pincode==pincode).filter(Postoffices.taluk!='NA').all())
1444
            if len(listCities)>0:
1444
            if len(listCities)>0:
1445
                for j in listCities:
1445
                for j in listCities:
1446
                    cities.append(j.taluk)
1446
                    cities.append(j.taluk)
1447
                json_data['cities'] = cities
1447
                json_data['cities'] = cities
1448
                json_data['state'] = listCities[0][1]
1448
                json_data['state'] = listCities[0][1]