sql: don't use data_class() to get table name for relations (#52147)
gitea-wip/wcs/pipeline/head Build started... Details
gitea/wcs/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Frédéric Péters 2021-03-17 21:23:15 +01:00 committed by Thomas NOËL
parent b5ee70fbfc
commit 2532358f68
1 changed files with 2 additions and 2 deletions

View File

@ -1455,10 +1455,10 @@ class SqlMixin(object):
'LEFT JOIN users ON (CAST(%s.user_id AS INTEGER) = users.id)' % cls._table_name
)
else:
carddef_dataclass = field.carddef.data_class()
carddef_data_table_name = get_formdef_table_name(field.carddef)
carddef_table_alias = 't%s' % id(field.carddef)
carddef_table_decl = 'LEFT JOIN %s AS %s ON (CAST(%s.%s AS INTEGER) = %s.id)' % (
carddef_dataclass._table_name,
carddef_data_table_name,
carddef_table_alias,
cls._table_name,
get_field_id(field.parent_field),