예제 #1
0
 def get_total_count_moderation_wares():
     """
     Получение общего количества товаров на модерацию
     :return:
     """
     search_req1 = WarehouseMethods.get_SearchRequestDto(stock_states=[2], moderation_states=[1])
     search_req2 = WarehouseMethods.get_SearchRequestDto(stock_states=[3], moderation_states=[3])
     result1 = services.warehouse_index.root.tframed.search(search_req1)
     result2 = services.warehouse_index.root.tframed.search(search_req2)
     total_count = result1.totalCount + result2.totalCount
     return total_count
예제 #2
0
 def created_req(limit_n=1, offset_n=0):
     """ Формируем запрос для условий выборки товара.
     :param limit_n: лимит
     :param offset_n: смещение
     :return: запрос
     """
     pag = AccountingMethods.get_PaginationDto(limit=limit_n, offset=offset_n)
     search_req = WarehouseMethods.get_SearchRequestDto(search_category=index.categoryId, pagination=pag,
                                                        stock_states=[1, 2, 3, 4, 5],
                                                        moderation_states=[1, 2, 3, 4])
     p = services.warehouse_index.root.tframed.search(search_req)
     return p