On Fri, Feb 20, 2009 at 12:36 AM, Robin B <[email protected]> wrote:

>
> I have the transactions working, but it is not fully compatible with
> web2py DAL, but it could be soon ( needs type coercion, db.table.ALL,
> etc)  Also in web2py, you cannot set the entity group when inserting,
> so transactions will only involve 1 record.  (eg atomically read/
> modify/write a counter in a transaction)
>


that is great, at least we can do counters !...

and how could we specify a parent in a antity with web2py ? is there any
simple way ?

thanks !


>
> If you needed transactions immediately, you could do this:
>
> from google.appengine.ext import gdb
>
> def txn():
>  post = db.posts[post_id]
>  post.update_record(title='foo')
>  return post
>
> post = gdb.run_in_transaction(txn)
>
> On a side note, I have batch operations working too. But I recently
> read that batch operations are just O(n), which unfortunately means no
> joins or efficient batch operations will be possible for now, but I
> have not benchmarked it on the real google datastore to know for sure.
>
> Robin
>
>
> On Feb 19, 3:31 pm, sebastian <[email protected]> wrote:
> > Hi All,
> >
> > is there any schedule for the GAE transactions/entity groups ?
> >
> > if not, how would it be the best way (web2py upgrades compatible !) to
> > use entity groups and transaction with web2py ?
> >
> > thanks
> >
> > On Jan 19, 2:59 pm, Robin B <[email protected]> wrote:
> >
> > > > Groups under the DAL to be a single record. Since Big Table
> > > > transactions are limited to one Entity Group pertransaction, this
> > > > means that we are limited to one record pertransaction. Right?
> >
> > > You have it right.
> >
> > > > In the example above, 'count' is just an example of some arbitrary
> > > > column in the record, right? Can I have multiple assignments? Can I
> > > > mix lambda and non-lambda assignments? E.g.:
> >
> > > >     row.update_record(count=lambda r: r.count+1, vote_score=lambda r:
> > > > calculate_vote_score(), preference='blue')
> >
> > > Yes, you would be able to mix lamdas/functions and values.
> >
> > > On the subject of passing lamdas as attributes, the field.default=
> > > should also recognize any lambda/callable and call it on demand:
> >
> > > def uuid():
> > >   import uuid
> > >   return uuid.uuid4()
> >
> > > db.table.created_at.default=t2.now
> > > db.table.uuid.default=uuid
> >
> > > Robin
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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