Re: [web2py] Re: how to make Query, without redundance

2016-11-29 Thread Áureo Dias Neto
Thank you man! you help me <3 2016-11-29 2:35 GMT-02:00 Anthony : > On Monday, November 28, 2016 at 10:22:53 PM UTC-5, Áureo Dias Neto wrote: >> >> Friend, it worked perfectly! thank you! >> >> Now, I want to do the inverse of this query, ie select vehicles from the >> vehicles table, which have

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
On Monday, November 28, 2016 at 10:22:53 PM UTC-5, Áureo Dias Neto wrote: > > Friend, it worked perfectly! thank you! > > Now, I want to do the inverse of this query, ie select vehicles from the > vehicles table, which have no reference in some record in the table of > photos, ie want to select v

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
Friend, it worked perfectly! thank you! Now, I want to do the inverse of this query, ie select vehicles from the vehicles table, which have no reference in some record in the table of photos, ie want to select vehicles that do not have photos .. could you help me? -- Resources: - http://web2py.c

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
In your query, are you doing a join with the photos table to actually retrieve the photos? If so, only the records with photos will be returned (assuming an inner join). Otherwise, you can do a nested select :

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
I have a table, called 'vehicles', and this has so many fields. In another, table, called 'photos', I have a field, called 'Vehicle', which is reference to my vehicle table .. I'm doing a search form, and I need to filter records from my vehicle table, which have been referenced in the 'photos' ta

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
On Monday, November 28, 2016 at 5:13:30 AM UTC-5, Áureo Dias Neto wrote: > > > Good Morning, With this line of code, do I get the records of the tables > referenced in table A? > No, it wasn't clear what you were looking for. > My question is as follows, I have two tables, A and B, I want to

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
have some record in the table referenced this record of *B* 2016-11-28 8:12 GMT-02:00 Áureo Dias Neto : > > Good Morning, With this line of code, do I get the records of the tables > referenced in table A? My question is as follows, I have two tables, A and > B, I want to check which records

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
Good Morning, With this line of code, do I get the records of the tables referenced in table A? My question is as follows, I have two tables, A and B, I want to check which records in table A, have some record in the table referenced this record of A hug 2016-11-26 11:33 GMT-02:00 Anthony : > Not

[web2py] Re: how to make Query, without redundance

2016-11-26 Thread Anthony
Not sure I understand exactly, but if you want to know whether tableA is referenced by any other tables, you can do something like: tableA_referenced_by = set(field._table for field in db.tableA. _referenced_by) That will give you a set of any tables (the actual DAL Table objects) that have fie