Hi,

I found the answer to this question, so if anyone else is looking for an
answer to this question, here is the solution.

in your model you need to just add 'id' to the to your primary field here
is an example.

db.define_table(
'product',
Field('id_product','id'),
your other fields as usual ........

notice the 'id' which web2py then knows that this should be treated as the
ID field that it is looking for.

Thanks
Simon

On 17 August 2012 20:45, Simon Carr <simonjc...@gmail.com> wrote:

> Do I need an ID field in my database when using the SQLForm.grid
>
> I am reading data from a legacy MySQL database which does not have an id
> field.
>
> Many thanks
> Simon
>
> --
>
>
>
>

-- 



Reply via email to