This is the most important  one:
db.posts.insert(**attrs)
db.posts << attrs

And the batched versions:
db.posts.insert([attrs1,attrs2])
db.posts << [attrs1,attrs2]

With the batched versions, GAE can insert 1000s of records in
parallel.

You are right, the rest of the syntax can wait.

Robin



On Feb 1, 11:30 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> please send me a summary email. I will review this and they should be
> easy to implement.
> Mind I do not want to use all possible operators for duplicaiton of
> syntax since this may preclude use for new features we have not
> thought of.
>
> Massimo
>
> On Feb 1, 10:24 am, Robin B <robi...@gmail.com> wrote:
>
> > Python reverses the order of __contains__(seq,obj) arguments, so:
> > (db.posts.tags in ['web2py'])
>
> > would have to be:
> > ('web2py' in db.posts.tags)
> > (['web2py','cool'] in db.posts.tags)
>
> > Not all bad,
>
> > Robin
>
> > On Feb 1, 9:54 am, Robin B <robi...@gmail.com> wrote:
>
> > > A syntax for batch put/insert:
>
> > > db.posts.insert([attrs1,attrs2])
>
> > > db.posts << [attrs1,attrs2]
>
> > > Robin
>
> > > On Feb 1, 9:35 am, Robin B <robi...@gmail.com> wrote:
>
> > > > Instead of:
> > > > db.posts[0] = db.posts[5] #for insert
>
> > > > How about:
> > > > db.posts << db.posts[5] # operator.__lshift__(a, b)
>
> > > > and also:
> > > > db.posts << db.posts(**attrs) # default attrs
>
> > > > 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 web2py@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