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)
def __init__(self, context): self._repository = DiscountRepository() super(DiscountFacade, self).__init__(context)