form validation example doesn't run as posted?

21 views
Skip to first unread message

idm

unread,
Sep 15, 2009, 2:38:44 AM9/15/09
to django-piston
Hi all,

I was having some trouble with the form validation code here:

http://bitbucket.org/jespern/django-piston/wiki/Documentation#form-validation

I think the examples might omit:

from piston.util import validate

Is that right? Here's an example in context:



from piston.handler import BaseHandler
from piston.utils import validate
from crm.models import Report
from crm.forms import ReportForm

class ReportsHandler(BaseHandler):
allowed_methods = ('POST')

@validate(ReportForm)
def create(self, request):
...


Either that, or I'm missing something more fundamental here... but it
appears to be working now.

Thanks,
Ian

Idan Gazit

unread,
Sep 15, 2009, 3:55:00 AM9/15/09
to django...@googlegroups.com

On Sep 15, 2009, at 9:38 AM, idm wrote:

>
> I think the examples might omit:
>
> from piston.util import validate
>
> Is that right?

Yep.

Reply all
Reply to author
Forward
0 new messages