Krys Wilken schrieb:
> I also used the default method as a opportunity to convert the number 7 into 
> the real database object and feed that, instead, to the real method (edit).  
> That way there is less boilerplate code in each method.
> 
> By crafting a common, generic default method, you can just subclass your own 
> custom controller, rather than Controller, itself, and get the functionality 
> for free.

See here for an example of such a controller base class for the first form:

http://paste.turbogears.org/paste/1349

and a small variation:

http://paste.turbogears.org/paste/1350

The second from (object/edit/1) requires that you always pass the object
id as a (hidden) field in your edit form (and have it defined in your
form widgets fields), whereas, with the first form and this base class,
the id is extracted from the url automatically.

Chris



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to