On 24 August 2011 18:33, Massimo Di Pierro <massimo.dipie...@gmail.com>wrote:

> I think you want:
>
> def journal_grid():
>    query = db.akb_journal.publisher == db.akb_publisher.uuid
>    fields = [db.akb_journal.title,db.akb_journal.standard_name,
>              db.akb_journal.issn, db.akb_journal.abbrev_iso,
>              db.akb_publisher.publisher, db.akb_journal.subject]
>     form = SQLFORM.grid(query, fields, deletable= False)
>    return dict(form = form)
>
> or
>
> def journal_grid():
>    form = SQLFORM.smartgrid(db.akb_journal, deletable= False)
>    return dict(form = form)
>
>
Thanks, but now I get another problem.  And it does not help if I include
the id field in the field list:

  File "/home/js/web2py/applications/akb/controllers/default.py"
<http://localhost:8000/admin/default/edit/akb/controllers/default.py>,
line 96, in journal_grid
    form = SQLFORM.grid(query, fields, deletable= False)
  File "/home/js/web2py/gluon/sqlhtml.py", line 1480, in grid
    id = row[field_id]
  File "/home/js/web2py/gluon/dal.py", line 3817, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'id'


Regards
Johann
-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
                                                    2 Pet. 1:2b,3a

Reply via email to