The issue is just a missing backet

db((db.Record.Group_id==ID)&(!
db.Record.Name.belongs(List_of_names))).delete()

On Apr 1, 1:01 pm, Magnitus <eric_vallee2...@yahoo.ca> wrote:
> Thanks for both replies :).
>
> So, if ``db().select(db.Record.Name)``  acts like a tuple, then I can
> do something like this:
>
> Names_in_db = db().select(db.Record.Name)
> for Name in List_of_names:
>     if Name in Names_in_db:
>         #Update logic goes here
>     else:
>         #Insert logic goes here
>
> Also, I have another question:
>
> The belongs member function for DAL.Table.Field allows you to isolate
> rows for which a particular field is in a given set of values.
>
> Is there a short direct way to specify that you actually want to
> isolate the rows for which a particular field is in the complement of
> the set?
>
> Likes (for example... actually, its pretty much what I'm trying to do
> in my code):
>
> db(db.Record.Group_id==ID & (!
> db.Record.Name.belongs(List_of_names))).delete()
>
> Note: The above syntax is not correct and gives an error, but it
> illustrates what I'm trying to achieve.
>
> On Apr 1, 10:30 am, Thadeus Burgess <thade...@thadeusb.com> wrote:
>
> > ``db().select(db.Record.Name)`` returns a rows object, which acts like a 
> > tuple.
>
> > -Thadeus
>
> > On Thu, Apr 1, 2010 at 5:06 AM, DenesL <denes1...@yahoo.ca> wrote:
> > > thelist=[row.Name for row in db().select(db.Record.Name)]
>
> > > On Apr 1, 1:41 am, Magnitus <eric_vallee2...@yahoo.ca> wrote:
> > >> Hi,
>
> > >> assuming that I have a "Record" table with a field called "Name" in
> > >> the database (all also that there are a bunch of other fields for that
> > >> table).
>
> > >> Assume that I make the following query:
>
> > >> Rows = db().select(db.Record.ALL)
>
> > >> Is there a way to directly (with one line without having to iterate
> > >> through each row and create the tuple/list manually) fetch the "Name"
> > >> field for all the rows in a tuple/List?
>
> > > --
> > > 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 
> > > athttp://groups.google.com/group/web2py?hl=en.

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