From: Jeremy <finde...@gmail.com>
Date: Wed, 4 Mar 2009 07:17:38 -0500
Local: Wed, Mar 4 2009 7:17 am
Subject: RE: django forms (media) + pyjamas
Sure, I'll do that tonight and will make it a bit more non-trivial with a ModelForm that allows you to save/edit the form with an instance or a new form.
The problem that this example solves is field validation based on an existing form. It can work with a modelform too...so you would just write processing logic then write f.save() to write it to the database. If it's invalid you return the errors and pyjamas processes them and displays them. What it doesn't solve is translating a form automatically into pyjamas, but it is very easy to wrap it so it only takes a few lines of code per form in pyjamas to dynamically display it...I'm a control freak though and like to build up each form so I can determine style and everything. But it's not hard to write a form handler in pyjamas to handle and display the errors. I'll include all of that tonight when I get home. -----Original Message-----
From: lkcl <luke.leigh...@googlemail.com> Sent: Wednesday, March 04, 2009 5:44 AM To: pyjamas-dev <pyjamas-dev@googlegroups.com> Subject: Re: django forms (media) + pyjamas On Mar 4, 5:12 am, Jeremy <finde...@gmail.com> wrote:
oo that would be handy to have.
> #BSD licensed
> from django.http import HttpResponse
> class JSONRPCService(object):
<snip>
> class SimpleForm(forms.Form):
> def builderrors(form):
> class FormProcessor(JSONRPCService):
> processor = FormProcessor()
err.... err....
intuitively i think this is utterly utterly cool - but i don't
would you mind doing a couple of things:
1) putting together a really simple example which uses this
2) throwing it at either the wiki, the bugtracker or the pyjamas-dev
3) sending a 2-3 sentence para answering the questions "what does
i.e. is it a way for alain to "hook into" any existing django "Forms"
because if so, that would be utterly cool.
l.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||