From 45b8d9fb8456dfccf3cefaf42876e6d64d15b00d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 25 Mar 2023 11:28:53 -0500 Subject: [PATCH] Fix table sorting for FK reference column in new table wizard also add LargeBinary data type option --- tailbone/templates/tables/create.mako | 1 + tailbone/views/tables.py | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tailbone/templates/tables/create.mako b/tailbone/templates/tables/create.mako index 3ebad9d1..dfe6cc45 100644 --- a/tailbone/templates/tables/create.mako +++ b/tailbone/templates/tables/create.mako @@ -183,6 +183,7 @@ + diff --git a/tailbone/views/tables.py b/tailbone/views/tables.py index d11a2923..75a61086 100644 --- a/tailbone/views/tables.py +++ b/tailbone/views/tables.py @@ -24,13 +24,10 @@ Views with info about the underlying Rattail tables """ -from __future__ import unicode_literals, absolute_import - import os import sys import warnings -import six from sqlalchemy_utils import get_mapper from rattail.util import simple_error @@ -203,8 +200,8 @@ class TableView(MasterView): branch_name = None kwargs['branch_name'] = branch_name - kwargs['existing_tables'] = [{'name': table.name} - for table in model.Base.metadata.sorted_tables] + kwargs['existing_tables'] = [{'name': table} + for table in sorted(model.Base.metadata.tables)] kwargs['model_dir'] = (os.path.dirname(model.__file__) + os.sep) @@ -294,7 +291,7 @@ class TableView(MasterView): 'column': column, 'sequence': i, 'column_name': column.name, - 'data_type': six.text_type(repr(column.type)), + 'data_type': str(repr(column.type)), 'nullable': column.nullable, 'description': column.doc, })