Closed bsnacks000 closed 2 months ago
@tinnaing347 We need to add Generic here ... missed this when we built it. Otherwise mypy complains about Liskov when we try to specialize ...
Generic
class IListQueryable(abc.ABC, Generic[ListViewQueryParamsModelT, Auth0UserT]): # <-------------- Add this generic @abc.abstractmethod def query_stmt( self, transaction: TransactionManager, where: context.ListContext[ListViewQueryParamsModelT, Auth0UserT], ) -> SaSelect: ...
Then in our app it looks like this:
class BemawebPropertyListView( IListQueryable[BemawebPropertyQueryParams, HiveAuth0User] ): def query_stmt( self, transaction: TransactionManager, where: ListContext[BemawebPropertyQueryParams, HiveAuth0User], ) -> SaSelect: < sqla statement builder code here >
@tinnaing347 We need to add
Generic
here ... missed this when we built it. Otherwise mypy complains about Liskov when we try to specialize ...Then in our app it looks like this: