I mean if we have a list of products called:

Product 1
Product 2
Product 3
Product 4

And we have a list of registered buyers:

Buyer 1
Buyer 2
Buyer 3

And the sales contains which products a buyer has bought:

Buyer 1 Product 1
Buyer 2 Product 2 Product 3

What I'm trying to figure out is, when a buyer logs in (and therefore 
auth.user.id is set), how do I get the Rows for all products that the 
current buyer has not bought yet?

The result should be something like this for each buyer:

Buyer 1 should see Product 2, Product 3, Product 4.
Buyer 2 should see Product 1, Product 4.
Buyer 3 should see Product 1, Product 2, Product 3, Product 4.

I tried something like this:

rows = db((db.sale.product != 
db.product.id)&(db.sale.buyer==auth.user.id)).select()   # want to select 
all products that are not found in sale.product for this user.

But this returns 0 Rows.

On Friday, February 15, 2013 9:34:42 PM UTC-5, 黄祥 wrote:
>
> what do you mean by sales? is it in the session order or is it in the 
> table?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to