Fixed FormAlchemy table rendering when underlying session is not primary.
This was needed for a grid based on a LOC SMS session.
This commit is contained in:
parent
42d0e52b89
commit
c2b2601103
|
@ -36,7 +36,7 @@ from edbob.util import prettify
|
||||||
|
|
||||||
from rattail.pyramid.grids.core import Grid
|
from rattail.pyramid.grids.core import Grid
|
||||||
from rattail.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
|
from sqlalchemy.orm import object_session
|
||||||
|
|
||||||
__all__ = ['AlchemyGrid']
|
__all__ = ['AlchemyGrid']
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ class AlchemyGrid(Grid):
|
||||||
|
|
||||||
def iter_rows(self):
|
def iter_rows(self):
|
||||||
for row in self._formalchemy_grid.rows:
|
for row in self._formalchemy_grid.rows:
|
||||||
self._formalchemy_grid._set_active(row)
|
self._formalchemy_grid._set_active(row, object_session(row))
|
||||||
yield row
|
yield row
|
||||||
|
|
||||||
def page_count_options(self):
|
def page_count_options(self):
|
||||||
|
|
Loading…
Reference in a new issue