I cannot answer the question whether web2py is the right choice for
not since I am not familiar with JDO/JPA and therefore I am not sure
about what they do.

I can anyway answer your specific questions. The answer is yes, you
can to both with a caveat discussed below:

Say for example that you have a db.person. You can sent all persons to
the client via

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

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.

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?
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.





On Jan 17, 12:30 pm, "K.R.Arun" <[email protected]> wrote:
> hi,
> Today I had been thinking about JDO/JPA stuff that I did for my GWT
> based project.
> And I figured something out of python-gwt-rpc.
>
> But I have a doubt that, whether I can use web2py for server side or
> not?!!
>
> I doubted because I don't know whether detached entities are possible
> as in JDO/JPA with web2py.
> I'm satisfied with web2py ORM capabilities.
> But I want to know:
> *) Is it possible to send an entity from server to client update it
> there and persist it(update if changed, create if new) without using
> built in web2py forms? (ie., I want to use GWT and RPC, so I can't use
> web2py form facilities.)
>
> I think like this:
> 1) retrieve all entities of same kind and populate my web app with
> that data(better if there is paging)
> 2)create an entity? fill out entity class and send it to web2py for
> serialization(with db)
> )Update? will contain id in the entity, so updated fields get
> automatically persisted (instead of creating new one) at the server.
>
> Arun
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to