Hi,
I've got an application that shares a DB with another application running a
different framework. The setup is that my application declares a set of
tables that the other application can read from but won't write to, so I
haven't been exploring the mechanisms for connecting to legacy databases.
However, the other application requires a UUID primary key called Oid, to
use as a foreign reference in its own tables. I can easily add that as a
field:
db.define_table('project_details',
Field('oid', length=64, default=uuid.uuid4, rname='"Oid"'),
Field('project_id', 'reference project_id'),
Field('version', 'integer'))
What I can't figure out how to do is add that field to the primary key. For
legacy tables, it seems like using this would be the approach:
primarykey=['id','oid'],
However, from what I can tell, once you provide primarykey, the usual
mechanisms for creating the default integer id primary key get disrupted.
Any suggestions?
Thanks,
David
--
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.