On Tue, Jan 29, 2008 at 4:36 PM, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>  With a little help of pylons.controllers.dispatch_on you can achieve what
>  you want:
>
>  @dispatch_on(POST="do_create")
>  def create(self):
>     render("my form")
>
>  @validate(schema="something", form="create")
>  def do_create(self):
>     process(self.form_seult)
>
>  the form shown at create() can "submit to itself" so the external API only
>  sees the /create url while you avoid branching inside the method to do two
>  different jobs which is cleaner, IMHO.

i don't know dispatch_on before.  can routes be configured as mapping
POST method of /create to do_create() and GET to create()?  if it can,
it will have same effect as the code above.

-- 
Qiangning Hong
http://www.douban.com/people/hongqn/

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