Sorry my english is very poor and probably I described the problem in a bad
manner.
In my database I have a table and a view of that table.
Lets call them:
mytable
view_mytable
view_mytable is a db view. Defined as:
CREATE OR REPLACE VIEW view_mytable AS
SELECT
mytable.*
'myvalues' as other_field
FROM
mytable;
I define them in web2py:
db.define_table('mytable',Field('myfield'))
db.define_table('view_mytable',Field('myfield'),Field('other_field'))
with old web2py (2.9.5) I was able to do:
SQLFORM.grid(db.view_mytable, field_id=db.mytable.id)
and the grid showed all fields of db.view_mytable in the tabular data but
when editing, the grid allowed to me to edit directly db.mytable because
of: field_id=db.mytable.id
Now this behaviour, that I find useful, mainly to work on legacy databases
has changed.
But I found the solution while I was writing this reply.
SQLFORM.grid(db.view_mytable, field_id=db.mytable.id,
*auto_pagination=False*)
But pagination has nothing to do with my intent.
So I don't know if this way to proceed is/was/wannabe supported or not but
could save a lot of work.
Maybe the place to discuss of it is in github issue.
Thank you
On Tue, May 5, 2015 at 6:18 PM, Cássio Botaro <[email protected]>
wrote:
> I try to reproduce in 2.10.4 and i have two errors:
>
> first - Field('myfield) should be Field('myfield'), but i think it is
> only a typo.
> second - SQLFORM.grid(db.myview, field_id=db.mytable.id) should be
> SQLFORM.grid(db.myview,
> field_id=db.view.id <http://db.mytable.id/>)
>
> No more errors at all.
>
> No problems with orderby.
>
>
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Massimiliano
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.