From 539cdb0fd5423850a54940510475cb69ca13205b Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Tue, 12 Apr 2016 10:59:42 +0200 Subject: [PATCH] Adapted Transaction and TableHandler use --- activity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activity.py b/activity.py index 7076577..9076f1b 100644 --- a/activity.py +++ b/activity.py @@ -69,17 +69,17 @@ class Activity(ModelSQL, ModelView): @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor + cursor = Transaction().connection.cursor() sql_table = cls.__table__() - table = TableHandler(cursor, cls, module_name) code_exists = True - if TableHandler.table_exist(cursor, cls._table): - table = TableHandler(cursor, cls, module_name) + if TableHandler.table_exist(cls._table): + table = TableHandler(cls, module_name) code_exists = table.column_exist('code') super(Activity, cls).__register__(module_name) + table = TableHandler(cls, module_name) # Migration from 3.2: Remove type and direction fields table.not_null_action('type', action='remove') table.not_null_action('direction', action='remove')