I have dozens of tables in an existing MSSQL database, all with autonumber ID primary keys, but none of them are named 'id'. They are instead of the name PropertyID, ClientID, etc. The official documentation seems to suggest renaming each of these fields to 'id':
Deprecated Databases
web2py may connect to legacy databases under certain conditions:
- Each table must have a unique auto-increment integer field called "id"
- Entries must be specified exclusively using the "id" field.
If these conditions are not met, it is necessary to manually press ALTER TABLE to comply with these requirements or they cannot be accessed via web2py.
This should not be construed as limiting, but rather as one of many ways web2py encourages you to follow good practice.
However, this will require hacking into hundreds of existing queries in other applications that use this database. Of course, there must be some way to specify a name for the existing autonumber field, which will be used instead of 'Identifier'.
This seems to be the area where Django got it right and web2py got it terribly wrong . Or am I just missing something? It seems I just missed something ...
source
share