First post: Is this a bug?

55 views
Skip to first unread message

Mat Miles

unread,
Feb 22, 2015, 10:37:31 PM2/22/15
to web...@googlegroups.com
I had a project that a number of tables that reference other tables using MySQL as the DB. I started another project using SQlite and the reference tables did not work. I went over and over the project to see if I had a typo somewhere and could not find one. Finally I converted the table to MSSQL and the references began working. Is this a bug, or is there some configuration option that I am missing when using SQlite?

What I mean by the reference tables not working is that when you go to create a new record where one of the fields is referencing values in another table, the box would show for the field, but it would display as a text field with no values and not a dropdown list.

-mat


Paolo Valleri

unread,
Feb 23, 2015, 1:46:24 AM2/23/15
to web...@googlegroups.com
Can you post an example code?

Mat Miles

unread,
Feb 23, 2015, 5:44:43 PM2/23/15
to web...@googlegroups.com
db.define_table('daily_schedule',
                Field('the_day', type='date', label='Schedule Day', requires=IS_NOT_EMPTY()),
                Field('assignment_type_id', type='reference assignment_type', label='Assignment', requires=IS_NOT_EMPTY()),
                format = '%(the_day)s')

db.define_table('assignment_type',
                Field('name', type='string', label='Assignment Type'),
                format = '%(name)s')

Niphlod

unread,
Feb 24, 2015, 3:45:18 PM2/24/15
to web...@googlegroups.com
the first thing to be noted is that you'd need to define the referencED table before the referencING one. not strictly needed always but a good place to start.

Mat Miles

unread,
Feb 25, 2015, 11:38:29 AM2/25/15
to web...@googlegroups.com

I found that the problem was that my tables had become corrupted by making too many changes at once. When I removed the tables, ran database admin, then re-added the tables it worked. It was not related to the different db types.

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/uiFt4csLo-k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages