> db(db.person.id>0).select().json()
>

I assume XML in addition to JSON is possible(just in case I need to).
Now I have to parse the JSON data client side.

> you can then write a client so that if a second is updated it sends
> back it to the server and the sever does something like this
>
> @service.jsonrpc
> def update_record(new_record):
>     form=SQLFORM(db.person,record['id'])
>     form.accepts(new_record,formname=None)
>     return form.errors
>
> this function would be called via jsonrpc and recurs a errors if any.
>

Can you please provide me an example of calling this function from
client side. (I'm still new to python, don't have much experience with
this wonderful language)

> The caveat is that this makes the workflow more complex. What is
> between the time the record was sent to the client and the time the
> client sends an update a different client has updated the same record?

My objects, although they are of same kind, belongs to different
users. So one user's change doesn't effect another.
Currently I accomplish this in my J2EE project via server side session
(for authentication), But I've plan to change it to Spring Security.

That's to say, if one need to view or edit data, they ought to be
authenticated. I thing I can do that with web2py.

> You may need to check for that. This could happen with normal forms as
> well but it is normally unlikely. Now with your workflow this becomes
> very likely and you need to check for it. You need to implement such
> logic by checking a timestamp on each record.
>

There is no need for timestamps in my case(I think), just check for a
valid session and hence user. If it is not just show them the login
page.
(There's no shared record for now.)
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to