the request get/post data comes in from pyramid as unicode strings.

the values i have in the database / my code for constant on many items
are integers

let's use this as an example...

   account_type_ids= (1,2,3,4,5)
   other_type_ids= (1,2,3,4,5)
   third_type_ids= (1,2,3,4,5)


is there a better way of doing this:

   def unicode_wrap(listed):
       return [ u"%s" % i for i in listed ]

   class MySchema(formencode.Schema):
       account_type_id =
formencode.validators.OneOf( unicode_wrap(account_type_ids),
not_empty=True )
       other_type_id =
formencode.validators.OneOf( unicode_wrap(other_type_ids),
not_empty=True )
       third_type_id =
formencode.validators.OneOf( unicode_wrap(third_type_ids),
not_empty=True )

i've combed the formencode docs and list archives, but just I can't
figure out a good way to handle this.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to