Hi Stéphane,

thanks for sharing your thoughts. We need more of that. I especially 
like your style of critizing without demanding something from the 
developers.

Stéphane Raimbault schrieb:
> 1 - Don't use default arg to function used for error_handling, eg.
> 
>     def edit(self, id, tg_errors=None):
>     ...
> 
>     @error_handler(edit)
> 
>     You can see that 'id' has no default value, it's required to provide
>     error handling.

I can help you with that: For some reason, you need to use 'id' as a 
named parameter to get the value in tg_errors.
   def edit(self, id=None, tg_errors=None):

Some small advise: Avoid using names like 'id' or 'dir' because they 
overwrite builtin functions.

Additionally you could look into 'ModelValidators' which take an 
(integer) id and transform it into a model object so in your controller 
function you don't have to deal with integers, fetching model objects 
from the database, doing some error handling on invalid ids etc.

HTH
fs


--~--~---------~--~----~------------~-------~--~----~
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