I'm connecting to a legacy MSSQL database, and have an important table which
has an alphanumeric primary key:
db.define_table('module',
Field('modid', 'string'),
...
primarykey=['modid'])
When I generate an update SQLFORM (form = SQLFORM(db.module, index)), it
generates an Object Not Found error unless the key happens to be an integer.
Likewise, I can't do shortcut lookups a la db.module(index), but must use
db(db.module.modid==index).select().first()
Am I missing the correct method of using a string primary key, or is it always
a problem in web2py?
Adding a new autoincrement key to the module solves these, but there enough
tables and legacy processes relying on the existing key that I can't possibly
make a full switch.
--
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/groups/opt_out.