You can hide id field like this.

db.products.id.readable = False

SQLFORM.grid(db.products,deletable=False,editable=False,create=False,csv=Fa
lse,searchable=False,details=False,maxtextlength=100,fields=[db.products.id,db.products.name,db.products.description,db.products.price])


On Oct 21, 12:47 pm, horridohobbyist <[email protected]>
wrote:
> I'm guessing it's mandatory. I suppose I can live with it.
>
> Thanks.
>
> On Oct 21, 1:35 pm, Nate Atkinson <[email protected]> wrote:
>
>
>
>
>
>
>
> > Have you tried including db.products.id in the fields?
>
> > On Oct 21, 1:30 pm, horridohobbyist <[email protected]> wrote:
>
> > > I'm trying to specify exactly which fields to display in a grid, but I
> > > just can't get the syntax right. And the docs are of no help.
>
> > > Here's what I tried, among other things:
>
> > > SQLFORM.grid(db.products,deletable=False,editable=False,create=False,csv=Fa
> > >  
> > > lse,searchable=False,details=False,maxtextlength=100,fields=[db.products.na
> > >  me,db.products.description,db.products.price])
>
> > > No matter what I put into "fields=", I keep getting an error. What is
> > > the correct syntax, please?
>
> > > Thanks,
> > > Richard

Reply via email to