Hi Mike,

Thanks for your response and the analysis of the issue.

We will try to follow as you have suggested to resolve the issue.

As responded to Ben, we would certainly consider using Pyramid. Has Pyramid 
been used in any commercial and deployed platform?

Thanks,
Pinakee

 Please don't print this e-mail unless you really need to, this will preserve 
trees on planet earth. 
----------------------------Disclaimer-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The information contained in this message (including any attachments) is 
confidential and may be privileged. If you have received it by mistake please 
notify the sender by return e-mail and permanently delete this message and any 
attachments from your system. Please note that e-mails are susceptible to 
change and malwares. VVIDIA COMMUNICATIONS PVT LTD. (including its group 
companies) shall not be liable for the improper or incomplete transmission of 
the information contained in this communication nor for any delay in its 
receipt or damage to your system. 
-------------------------------------------------------------------------------------------------------------------------Disclaimer----------------------------------------------------------------------------------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf Of Mike Orr
Sent: 29 May 2012 23:55
To: [email protected]
Subject: Re: Issue with Validators

The particular problem is diagnosed below, but I'll first echo the 
recommendation to use Pyramid for new projects. Pyramid is "Pylons 2".
Pylons 1 has been in bugfix-only mode for a year, and is really only maintained 
to support existing deployments. Pyramid has significantly more thorough 
documentation. That was one of the reasons we switched:
both because the codebase was more flexible and offered new features, and also 
because the documentation was more complete so we didn't have to fill in the 
holes ourselves.

On Mon, May 28, 2012 at 9:59 PM, Pinakee Biswas <[email protected]> wrote:
> #@restrict('POST')
>    @validate(schema=NewPageForm(), form='new')
>    def create(self):
>        # Add the new page to the database
>        page = model.Page()
>        for k, v in self.form_result.items():
>            setattr(page, k, v)

> Module simplesite.controllers.page:66 in create          view
>>>  for k, v in self.form_result.items():
> AttributeError: 'PageController' object has no attribute 'form_result'

The validate decorator sets the 'form_result' attribute, but it bypasses 
validation if the request is a GET, which would lead to that error. (I've never 
understood why it defaults to this.) There's an argument to 'validate' to make 
it validate GET requests, see the source docstring 
(pylons.decorators.validate), especially the 'on_get'
and 'post_only' args.

As to why it's occurring now, there may have been changes to 'validate' since 
Pylons 0.9.7 (which the book was written for). Or are using GET in a situation 
where the tutorial assumes POST?

--
Mike Orr <[email protected]>

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


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