Do not initiate sql table when table_query is defined
issue7896 review64491002
This commit is contained in:
1 parent
131bb3b216
commit
fc5f906ce5
1 file changed
+3
-1
@@ -196,7 +196,6 @@ class ModelSQL(ModelStorage):
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
sql_table = cls.__table__()
|
||||
cursor = Transaction().connection.cursor()
|
||||
TableHandler = backend.get('TableHandler')
|
||||
super(ModelSQL, cls).__register__(module_name)
|
||||
@@ -205,6 +204,9 @@ class ModelSQL(ModelStorage):
|
||||
return
|
||||
|
||||
pool = Pool()
|
||||
# Initiate after the callable test to prevent calling table_query which
|
||||
# may rely on other model being registered
|
||||
sql_table = cls.__table__()
|
||||
|
||||
# create/update table in the database
|
||||
table = cls.__table_handler__(module_name)
|
||||
|
||||
Reference in new issue
Block a user