[web2py] Re: Adding to derived smartgrid constraints.

2012-10-03 Thread alex
I had a slightly different case, maybe useful to share. I had a table "model" with two references to "make" and I wanted the models in the grid, but filtered by one of the two referenced fields of the "make" table. db.py db.define_table('make', Field('name')) Make_one = db.make.with_alias(

[web2py] Re: Adding to derived smartgrid constraints.

2012-10-02 Thread Dominic Cioccarelli
Hi Massimo, many thanks. Actually, the problem was when I tried to make a general example out of my business specific problem ;-) Before I "translated" my problem into an example, there was actually not a many-to-many relationship. For the purpose of this exercise, let's just assume that all o

[web2py] Re: Adding to derived smartgrid constraints.

2012-10-02 Thread Massimo Di Pierro
You have other problems before you solve this one. your model<->option is a one-to-many but should be a many-to-many (many cars can have alloy-wheels and alloy-wheel is one of many possible options for each car). Grid does now allow many-to-many very well but you can try: db.define_table('mak