What happened to this?
/R
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
The as_json() and as_dict() methods looks useful, but still generates the
HTML component for the various inputs which I would then
have to pull the relevant information out of
Not exactly. the form serialization returns the widgets as HTML, but also
serialized form data such as the current
Thanks to all of you for your suggestions. I'm not sure which way I'll
tackle this, but I have a good understanding now of what my options are to
tweak the SQLFORM feature. Your help is much appreciated.
--
---
You received this message because you are subscribed to the Google Groups
Thanks for that Alan. Yes I realise that the server creates the form for
the clientapi, my wording was not very good.
The as_json() and as_dict() methods looks useful, but still generates the
HTML component for the various inputs which I would then have to pull the
relevant information out of.
I have looked in the gluon/validators.py but I have not been able to
follow how the form object is used to process the returned variables. I got
as far as seeing a traverse method being called but didn't see how that
called the individual validation methods.
The HTML form helpers
Thanks for that link to the web3py code, that looks much neater, but I
guess not all the functionality is there yet which might help. It looks
like the From initialisation and process methods skip the HTML generation
completely and the various style_x methods create the HTML version as
per
It seems it basically allows you to do some stuff, such as creating a
form from javascript on the client side, which would normally be
done in a web2py controller.
clientapi does not create any form client side. It asks the server for a
given form, thus allowing to keep a strict MVC pattern
Thanks for that link to the web3py code, that looks much neater, but I
guess not all the functionality is there yet which might help.
If you don't want to wait for a new webnpy release you can try the
following in web2py:
def myaction():
form = ...
return dict(form.as_dict())
Then
Thinking about this some more, what I would like would be for a controller
to generate this json:
{ form:
{ fields:
[ {name: 'id', type: 'int', value: 234, error: '', comment: ''},
{name: 'title', type: 'string', length: 100, value: 'My Test
Record', error: '', comment:
Good points. I think this is roughly the approach taken in web3py:
https://github.com/mdipierro/web3py/blob/master/web3py/forms.py.
Anthony
On Friday, April 19, 2013 4:49:57 PM UTC-4, RHC wrote:
Thinking about this some more, what I would like would be for a controller
to generate this
Thanks for the responses, a number of useful pointers there.
I have had a look at the sqlhtml.py and html.py to see if I can adapt one
of these to effectively produce a json version of a form which can be
validated when it is submitted. I came to the conclusion that I didn't
understand enough
I might take another look at the plugin_clientapi, but that looks to me
like it is aimed at using web2py just as as a database backend.
Allow me completely disagree with that. plugin_clientapi handles creation
and validation of forms (via the web2py api obviously), access control and
on the widgets part, nobody did anything (or, in other words, even if it
did, he/she didn't share with us).
On the serialize values as json shouldn't be hard, but you must hook up
your angular model with the data. Same thing goes for errors.
On the receive a json string and use those values to
There is validate_and_insert() and validate_and_update(), never use them
but was planning to... So I don't know if they return error that you could
exploit in angular and the retroaction can become weird I don't know you
may have a read about those methodes
Richard
On Wed, Apr 17, 2013 at 4:19
My main concern is that web2py's form validation and security features
are really useful but would clash with the angular way of doing
things. It seems to me that the way to get the two working together would
be to create an alternative to FORM/SQLFORM/CRUD that
instead of generating HTML
15 matches
Mail list logo