Skip to content
Snippets Groups Projects
Commit eacc15fa authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix a bug in the improved version of get_foreign_field.

parent 85f62bac
No related branches found
No related tags found
No related merge requests found
......@@ -242,16 +242,14 @@ def get_foreign_field(field):
# IS_IN_DB is not use.
# The parent key for the left join is the id key of the parent table
# the parent field is the first field of the parent table which differs id
if not validators:
i = field.type.index(' ')
ktablename = field.type[i:].strip()
for kfield in field._db[ktablename]:
if kfield.name != 'id':
return (ktablename, kfield.name, 'id')
i = field.type.index(' ')
ktablename = field.type[i:].strip()
for kfield in field._db[ktablename]:
if kfield.name != 'id':
return (ktablename, kfield.name, 'id')
return None
raise Exception
def get_id(table, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment