Hi Massimo, I think this still hasn't been added yet. I too am doing several inner joins with grid and I'm getting some rows that I consider duplicates and would like to get rid of them. The most straightforward way to remove these duplicates is perhaps calling select() on the Set object with the distinct keyword argument, or perhaps even use exclude() on the Rows object. To my knowledge grid does not yet have equivalents to distinct and exclude, unfortunately.
Will equivalents to distinct/exclude be added to grid anytime soon? I am surprised something so advanced like grid doesn't have this. Or would you know another way to remove duplicates from grid? Please advise. On Wednesday, April 10, 2013 at 9:14:12 AM UTC-4, Massimo Di Pierro wrote: > > Please open a ticket and we can add this. > > On Wednesday, 10 April 2013 04:46:14 UTC-5, Calvin wrote: >> >> Hi >> >> I have been struggling with how one could get just distinct records to >> show with SQLFORM.grid if the query passed to it involved more than one >> table? Doing an inner join tends to generate a lot of non-unique rows and >> hence it would be important to just filter out the unique ones. With >> select, there is support for the distinct keyword but this is not the case >> with SQLFORM.grid. >> >> Using the groupby keyword is one approach but this can get somewhat >> tedious having to specify the fields to group by in advance and hence, I >> would like to understand if the omission of support for distinct in >> SQLFORM.grid is by design? >> >> Many thanks >> Calvin >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.