Fix table sorting for FK reference column in new table wizard

also add LargeBinary data type option
This commit is contained in:
Lance Edgar 2023-03-25 11:28:53 -05:00
parent 2f8411ba2f
commit 45b8d9fb84
2 changed files with 4 additions and 6 deletions

View file

@ -183,6 +183,7 @@
<option value="Date">Date</option> <option value="Date">Date</option>
<option value="DateTime">DateTime</option> <option value="DateTime">DateTime</option>
<option value="Text">Text</option> <option value="Text">Text</option>
<option value="LargeBinary">LargeBinary</option>
<option value="_fk_uuid_">FK/UUID</option> <option value="_fk_uuid_">FK/UUID</option>
<option value="_other_">Other</option> <option value="_other_">Other</option>
</b-select> </b-select>

View file

@ -24,13 +24,10 @@
Views with info about the underlying Rattail tables Views with info about the underlying Rattail tables
""" """
from __future__ import unicode_literals, absolute_import
import os import os
import sys import sys
import warnings import warnings
import six
from sqlalchemy_utils import get_mapper from sqlalchemy_utils import get_mapper
from rattail.util import simple_error from rattail.util import simple_error
@ -203,8 +200,8 @@ class TableView(MasterView):
branch_name = None branch_name = None
kwargs['branch_name'] = branch_name kwargs['branch_name'] = branch_name
kwargs['existing_tables'] = [{'name': table.name} kwargs['existing_tables'] = [{'name': table}
for table in model.Base.metadata.sorted_tables] for table in sorted(model.Base.metadata.tables)]
kwargs['model_dir'] = (os.path.dirname(model.__file__) kwargs['model_dir'] = (os.path.dirname(model.__file__)
+ os.sep) + os.sep)
@ -294,7 +291,7 @@ class TableView(MasterView):
'column': column, 'column': column,
'sequence': i, 'sequence': i,
'column_name': column.name, 'column_name': column.name,
'data_type': six.text_type(repr(column.type)), 'data_type': str(repr(column.type)),
'nullable': column.nullable, 'nullable': column.nullable,
'description': column.doc, 'description': column.doc,
}) })