Removed reliance on global rattail.db.Session
class.
This commit is contained in:
parent
18453c0113
commit
7638020aa0
|
@ -31,6 +31,7 @@ from pyramid.renderers import render_to_response
|
|||
|
||||
from webhelpers.html import tags
|
||||
|
||||
import edbob
|
||||
from edbob.pyramid.forms import PrettyDateTimeFieldRenderer
|
||||
from ...forms import EnumFieldRenderer
|
||||
from ...grids.search import BooleanSearchFilter
|
||||
|
@ -140,7 +141,8 @@ class BatchCrud(CrudView):
|
|||
class ExecuteBatch(View):
|
||||
|
||||
def execute_batch(self, batch, progress):
|
||||
from rattail.db import Session
|
||||
from rattail.db import get_session_class
|
||||
Session = get_session_class(edbob.config)
|
||||
session = Session()
|
||||
batch = session.merge(batch)
|
||||
|
||||
|
|
|
@ -300,7 +300,8 @@ def print_labels(request):
|
|||
class CreateProductsBatch(ProductsGrid):
|
||||
|
||||
def make_batch(self, provider, progress):
|
||||
from rattail.db import Session
|
||||
from rattail.db import get_session_class
|
||||
Session = get_session_class(edbob.config)
|
||||
session = Session()
|
||||
|
||||
self._filter_config = self.filter_config()
|
||||
|
|
Loading…
Reference in a new issue