Hello,

Ok I think I figured it out:

class creditcardtype(BaseController):
         def __init__(self,name,value,parent=None):
              self.name=name
              self.value=value


def registration(self):
      self.cclist.append(creditcardtype("visa","visa"))
      self.cclist.append(creditcardtype
("americanexpress","americanexpress"))
      c.creditcardtypes=[(ct.name,ct.value) for ct in self.cclist]

That basically does what I want to do, however is there a better way
than this?

Much appreciated,
Garyc


On Jan 2, 10:40 am, gazza <[email protected]> wrote:
> Hello,
>
> I want to use a combo box in my template. I can use the standard html
> approach however I would like
> to use the pylons helper functions to accomplish this.
>
> In my controller,I have the following:
>
> c.credcardtypes=[("visa","visa")]
>
> the template has:
>
> ${h.select("fieldnm","initvalue",c.credcardtypes)}
>
> I dont know how to add multiple values to the combo list?
>
> Much appreciated,
> Garyc

--

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


Reply via email to