[Cubicweb] commit and rollback on rqlcontroller

Jinpeng Li mr.li.jinpeng at gmail.com
Fri Jun 13 14:56:08 CEST 2014


>
>
> I suspect you would like some kind of "session" + orm management
> client-side to help write the code, especially coming from the
> pyro-world.
>
> e.g::
>
>  from cwclientlib import session # I don't remember the details
>
>  with session(login='babar', password='celeste').remote_cnx() as cnx:
>      s = cnx.create_entity('Study', identifier=...)
>      su = cnx.create_entity('Subject', identifier=...)
>      su.cw_set(related_studies=s)
>      cnx.commit() # => Raise (Remote)ValidationError or succeed
>
> That would really be just syntactic sugar for your code above.
> I will leave implementing this as an exercise for the reader ;-)
>

Hi Aurélien,

That is a nice proposition. If I have enough time, I would like to
implement these in the future.

Best,
Jinpeng


>
> Providing an .execute on the cnx object would be the hard part ...
>
> Regards,
> Aurélien.
>
> _______________________________________________
> Cubicweb mailing list
> Cubicweb at lists.cubicweb.org
> http://lists.cubicweb.org/mailman/listinfo/cubicweb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20140613/882fbb2b/attachment.html>


More information about the Cubicweb mailing list