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 PM, Niphlod <[email protected]> wrote:

> 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 insert into a table"
> web2py trunk parses whatever valid json POSTed values (Content-Type:
> application/json) and fills up request.vars with the decoded json dict.
>
>
> On Wednesday, April 17, 2013 10:15:12 PM UTC+2, RHC wrote:
>>
>> I have recently been exploring the possibilities of AngularJS and so far
>> it looks like a great framework for interactive forms and general data
>> editing.
>>
>> I would love to use it with web2py as I love the way web2py works and
>> much prefer python to javascript :-)
>>
>> 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 would
>> generate a json object containing all the field details and data for
>> angular to then use to build the form or whatever interface is required.
>>
>> I would like to have a go at this but I know a lot gets done behind the
>> scenes to generate forms and then validate the forms and generate error
>> messages where validation fails. I don't want to try and recreate all these
>> features from scratch so I'm thinking that maybe it is possible to reuse
>> various methods and functions already used by the current form methods to
>> do the same thing but generate json instead of HTML. What I would like to
>> do is to be able to send a set of data (or a blank template) to the client
>> using json and then have this data all posted back to web2py as json and
>> have web2py validate this data and update/insert the relevant records.This
>> data could be a single record, or a record and many linked records from
>> another table.
>>
>> Does this sound feasible to those who know a bit more about how all these
>> form methods work behind the scenes? Can anyone give me a few pointers?
>> Even better has anyone already tackled this challenge who can share their
>> work? It seems to me that this kind of feature could be very useful for the
>> growing number of javascript front end frameworks available.
>>
>> Thanks.
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to