Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. FormAlchemy drop down list not setting values
  2. Location = model.meta.Session.query(model.Location)
  3.  
  4. cityCodes = {}
  5.  
  6. for row in Location:
  7.     cityCodes.update({row.city : str(row.location_code)})
  8.        
  9. EmpsPerson.wiw_location_code.label('Location').dropdown(options = cityCodes),
  10.        
  11. <option value="Dubai">Dubai</option>
  12. <option value="Portsmouth">Portsmouth</option>
  13. <option value="Toulouse">Toulouse</option>
  14. <option value="Singapore">Singapore</option>
  15.        
  16. for row in Location:
  17. cityCodes.append([row.city,int(row.location_code)])
  18.  
  19.  EmpsPerson.location_code.label('Location').dropdown(options=cityCodes)