Hi,
I am dealing with postgreSQL database with a fair number of tables and I
currently group
logically similar tables under different schemas.Now when I create the
model I following
the examples I was able to specify the schema using the rname.
However I have issues when linking records from tables in the same schema
(different from public)
Model:
db.define_table('uploads',
Field('upload_id', type='integer'),
Field('md5_signature', type='text'),
Field('original_filename', type='text'),
Field('filename', type='upload'),
Field('upload_date', type='datetime'),
Field('parent_upload_fk','reference upload.upload_id'),
Field('upload_status_fk','reference upload_statuses.upload_status_id',
represent=lambda id, row: db.upload_statuses(id).description if id else
''),
format='%(filename)s',
rname = 'manage.uploads',
primarykey=['upload_id'],
migrate=False)
db.define_table('upload_statuses',
Field('upload_status_id', type='integer'),
Field('description', type='text'),
format='%(description)s',
rname = 'manage.upload_statuses',
primarykey=['upload_status_id'],
migrate=False)
Controller
grid = SQLFORM.grid(query,
fields=[db.uploads.original_filename,
db.uploads.md5_signature,
db.uploads.upload_date,
db.uploads.upload_status_fk],
headers={'uploads.original_filename' : 'Filename',
'uploads.md5_signature' : 'Md5',
'uploads.upload_date' : 'Upload date',
'uploads.upload_status_fk': 'State'},
maxtextlengths={'uploads.md5_signature' :32,
'uploads.original_filename' : 80},
showbuttontext = False,
deletable=False,
editable=False,
details=False,
selectable=None,
create=False,
searchable = False,
user_signature=False)
return dict(grid=grid)
Error
<class 'psycopg2.ProgrammingError'> ERROR: la relationship
"manage.upload_statuses" does not exist
--
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.