For a legacy db you can do

db.define_table(...Field('staid','id'),...)

so staid is the id. It assumes id is an autoincrement or integer
field.

On Dec 10, 6:50 pm, Tim Michelsen <timmichel...@gmx-topmail.de> wrote:
> > You can tell your model the path to the existing sqlite database file
> > with something like
>
> [...]
>
> Thanks a lot for your verbose help! I really appreciate it.
>
> > As for telling it which existing field to use as the ID, as DenesL
> > pointed out if the field isn't already named ID I don't think you can
> > at the moment.
>
> > If you really want to use the station number (t.staid) as your ID, why
> > not just add a new field called ID to your existing table (using
> > sqlite-browser) and then set the value to match t.staid? Something
> > like
>
> I am not a database guru. So I still do not understand why t.staid could
> not be the PK (= ID).
>
> Regards,
> Timmie

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to