W liście gazza z dnia sobota 02 stycznia 2010:
> 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?

Why not this way:
c.creditcardtypes=[("visa","visa"), ("americanexpress","americanexpress")]

Also, why does creaditcardtype derive from BaseController?

-- 
Paweł Stradomski

--

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