Subversion Repositories SmartDukaan

Rev

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

Rev 15678 Rev 15679
Line 958... Line 958...
958
    else:
958
    else:
959
        if CONTACT_PRIORITY.index(retailerContact.contact_type) > CONTACT_PRIORITY.index(contactType):
959
        if CONTACT_PRIORITY.index(retailerContact.contact_type) > CONTACT_PRIORITY.index(contactType):
960
            retailerContact.contact_type = contactType
960
            retailerContact.contact_type = contactType
961
 
961
 
962
def addAddressToRetailer(agentId, retailerId, address, storeName, pin, city,state, updateType):
962
def addAddressToRetailer(agentId, retailerId, address, storeName, pin, city,state, updateType):
-
 
963
    print "I am in addAddress"
-
 
964
    try:
963
    if updateType=='new':
965
        if updateType=='new':
964
        retailer = session.query(Retailers).filter_by(id=retailerId)
966
            retailer = session.query(Retailers).filter_by(id=retailerId)
965
        retailer.address = address
967
            retailer.address = address
966
        retailer.title = storeName
968
            retailer.title = storeName
967
        retailer.city = city
969
            retailer.city = city
968
        retailer.state = state
970
            retailer.state = state
969
        retailer.pin = pin
971
            retailer.pin = pin
970
    raddress = RetailerAddresses()
972
        raddress = RetailerAddresses()
971
    raddress.address = address
973
        raddress.address = address
972
    raddress.agent_id = agentId
974
        raddress.agent_id = agentId
973
    raddress.city = city
975
        raddress.city = city
974
    raddress.pin = pin
976
        raddress.pin = pin
975
    raddress.retailer_id = retailerId
977
        raddress.retailer_id = retailerId
976
    raddress.state = state
978
        raddress.state = state
977
    session.commit()
979
        session.commit()
978
     
980
    finally:
-
 
981
        session.close() 
979
        
982
        
980
        
983
        
981
class Login():
984
class Login():
982
    
985
    
983
    def on_get(self, req, resp, agentId, role):
986
    def on_get(self, req, resp, agentId, role):