Re: [web2py] use executesql results in grid
yep but valid only for read-only grid. You need a unique integer value to use the grid for editing purposes What I do is to either create a database view or a table containing the result and then in the controller define a model with 'migrate = False' to read the view/table and then use the grid on that view/table. In order for web2py to use that view/table easily I put something like 'id = 1' in the select and then make the id field 'readable=False' in the controller. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- 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.
[web2py] use executesql results in grid
I am doing a quite complicated sql select with selects nested, which I do not know how to create using DAL, so I decided to go with executesql with fields specified. My questions is once I get back results of class 'gluon.dal.Rows' type, is there a way to create a SQLFORM.grid with them? I am able to use SQLTABLE, but I would lose the inline editing ability as suggested in http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript Thanks -- 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.
Re: [web2py] use executesql results in grid
On 14 April 2014 18:35, Yufei Li ymzz...@gmail.com wrote: I am doing a quite complicated sql select with selects nested, which I do not know how to create using DAL, so I decided to go with executesql with fields specified. My questions is once I get back results of class 'gluon.dal.Rows' type, is there a way to create a SQLFORM.grid with them? I am able to use SQLTABLE, but I would lose the inline editing ability as suggested in http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript What I do is to either create a database view or a table containing the result and then in the controller define a model with 'migrate = False' to read the view/table and then use the grid on that view/table. In order for web2py to use that view/table easily I put something like 'id = 1' in the select and then make the id field 'readable=False' in the controller. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- 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.