Пример #1
0
class DiscountFacade(BaseFacade):
    def __init__(self, context):
        self._repository = DiscountRepository()
        super(DiscountFacade, self).__init__(context)
    def list(self, param = None):
        if (param == None):
            param = DiscountQueryViewModel(start_date=datetime.today())
        param.user_id = self._context.user_id
        entities = self._repository.list(param)
        return map(lambda e:obj_map(e, DiscountViewModel), entities)
Пример #2
0
 def __init__(self, context):
     self._repository = DiscountRepository()
     super(DiscountFacade, self).__init__(context)