Fix some imports etc. regarding new batch system.

This commit is contained in:
Lance Edgar 2015-01-20 00:51:51 -06:00
parent b05f30d9fe
commit 7c761bee99
2 changed files with 6 additions and 12 deletions

View file

@ -29,13 +29,6 @@ Backoffice Web Application for Rattail
from ._version import __version__
# TODO: Ugh, hack to get batch models loaded before views can complain...
from rattail.db import model
from rattail.db.batch.vendorcatalog.model import VendorCatalog, VendorCatalogRow
model.VendorCatalog = VendorCatalog
model.VendorCatalogRow = VendorCatalogRow
def includeme(config):
config.include('tailbone.static')
config.include('tailbone.subscribers')

View file

@ -28,7 +28,8 @@ from __future__ import unicode_literals
from rattail.db import model
from rattail.db.api import get_vendor
from rattail.db.batch.vendorcatalog import VendorCatalogHandler
from rattail.db.batch.vendorcatalog import VendorCatalog, VendorCatalogRow
from rattail.db.batch.vendorcatalog.handler import VendorCatalogHandler
from rattail.vendors.catalogs import iter_catalog_parsers, require_catalog_parser
import formalchemy
@ -41,7 +42,7 @@ class VendorCatalogGrid(FileBatchGrid):
"""
Grid view for vendor catalogs.
"""
batch_class = model.VendorCatalog
batch_class = VendorCatalog
batch_display = "Vendor Catalog"
route_prefix = 'vendors.catalogs'
@ -75,7 +76,7 @@ class VendorCatalogCrud(FileBatchCrud):
"""
CRUD view for vendor catalogs.
"""
batch_class = model.VendorCatalog
batch_class = VendorCatalog
batch_handler_class = VendorCatalogHandler
route_prefix = 'vendors.catalogs'
@ -116,7 +117,7 @@ class VendorCatalogRowGrid(BatchRowGrid):
"""
Grid view for vendor catalog rows.
"""
row_class = model.VendorCatalogRow
row_class = VendorCatalogRow
route_prefix = 'vendors.catalogs'
def filter_map_extras(self):
@ -150,7 +151,7 @@ class VendorCatalogRowGrid(BatchRowGrid):
class VendorCatalogRowCrud(BatchRowCrud):
row_class = model.VendorCatalogRow
row_class = VendorCatalogRow
route_prefix = 'vendors.catalogs'