Foreign key error after adding new table instance

27 views
Skip to first unread message

Steve

unread,
Jun 16, 2019, 11:53:33 AM6/16/19
to web2py-users
Hi All,

Busy with my platform, just added some tables.
I have defined extra fields for the Auth table.

In 1 of the aded fields i use a different table to get some info.
2 days ago i added 3 row's which are available for me to select. When i add a new user i am able te select one of those rows and add the user ...NO PROBLEM

Today i added 1 extre row to the referenced field, and suddenly i get an FOREIGN KEY error, and only when i select the newly added row. If i select one of the other rows ... NO PROBLEM

Anyone any idea why this can happen .



db.define_table('caretype',
                Field('caretype', requires=IS_NOT_EMPTY(), label=T('Caretype')),
                Field('description', requires=IS_NOT_EMPTY(), label=T('Description')),
                auth.signature,format='%(description)s', migrate=False)

added auth rows

auth.settings.extra_fields['auth_user']= [
                Field('work_position',db.caretype, label=T('Profession')),
                Field('picture', 'upload', default='static/images/user_icon.png'),]

Steve

Steve

unread,
Jun 18, 2019, 6:02:55 PM6/18/19
to web2py-users
OK,

After searching the sqlite db and the views .... problem solved.
DB inegrity was ok ... the view was wrong 




Op zondag 16 juni 2019 17:53:33 UTC+2 schreef Steve:
Reply all
Reply to author
Forward
0 new messages