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:
Lance Edgar 2013-08-10 11:57:03 -07:00
parent 42d0e52b89
commit c2b2601103

View file

@ -36,7 +36,7 @@ from edbob.util import prettify
from rattail.pyramid.grids.core import Grid
from rattail.pyramid import Session
from sqlalchemy.orm import object_session
__all__ = ['AlchemyGrid']
@ -92,7 +92,7 @@ class AlchemyGrid(Grid):
def iter_rows(self):
for row in self._formalchemy_grid.rows:
self._formalchemy_grid._set_active(row)
self._formalchemy_grid._set_active(row, object_session(row))
yield row
def page_count_options(self):