On 29 Jan 2008, at 16:53, Matt Feifarek wrote:

> On Jan 29, 2008 11:21 AM, Mike Orr <[EMAIL PROTECTED]> wrote:
>
> Yes, we're disagreeing on what the default should be.  Well, you'll
> have to convince Ben.  I think he likes it the other way.
>
> I don't have this particular religion, but what would a REST zealot  
> say? Seems like two different URI's for the same thing is bad.
>
> I've hacked up my base controller class to make it work the way that  
> Steven wants. I suppose to me, clean URIs are better than clean  
> controllers. And in my case, the "mess" isn't in my controllers,  
> it's in my base controller class.
>
> Plus, I'm not sure that decorators make things cleaner; it just puts  
> some mysterious magic in my code. @validate is pretty easy to  
> understand magic, but it's still one little line that completely  
> changes the expected dispatch behavior of pylons (one url = one  
> request = one route = one action = one method = one response). I  
> don't like 'em.
>

I'm not a fan of @validate either, as a general rule. I like being  
able to select schemas at request time (for things like a  
CRUDController it lets me have subclasses with things like  
create_schema = <foo>). However, I can see that @validate would be  
very useful for a significant number of common cases.

The ideal way to handle forms, in my opinion, is to always redirect  
after a POST. If there are errors, save the Invalid exception and  
redirect to the referrer. This allows form actions to be targeted by  
multiple forms in different places. (The usual example I give of this  
is adding products to a shopping cart--I want to be able to have the  
add form both on the product summary and on the full product page.  
Redirecting to referer automatically does the right thing).


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