Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- САМ СЕЛЕКТОР !!!!
- def get_source_of_payment_select(request):
- """Используется для ajax запроса options для select"""
- context = json.loads(request.body.decode('utf-8'))
- search_query = str(context.get('search_query', '')).strip()
- search_query = split_query(search_query)[:500]
- limit = str(context.get('limit', ReferenceBookSelectorFilter.ITEMS_PER_PAGE))
- limit = safe_to_int(limit, ReferenceBookSelectorFilter.ITEMS_PER_PAGE)
- page = str(context.get('page', 1))
- page = safe_to_int(page, 1)
- is_exact = context.get('exact', False)
- select_filter = ReferenceBookSelectorFilter(
- page=page,
- limit=limit,
- request=request,
- is_exact=is_exact,
- search_query=search_query,
- field_name='source_of_payment',
- reference_books=LVLeadPaymentHistory.BASE_REFERENCE_BOOKS,
- )
- return JsonResponse(select_filter.get_select_data())
- Url path !!!!!
- path(
- r'ajax/source_of_payment_select',
- csrf_exempt(source_of_payment_select.get_source_of_payment_select),
- name='source_of_payment_select'
- ),
- cls.get_formated_field(
- name='source_of_payment_field', field_type=cls.DataFormat.SELECT_AJAX, is_reference_book=True
- is_reference_book=True, reference_book_name = LVLeadPaymentHistory.BASE_REFERENCE_BOOKS, <- Вот тут
- url=reverse('source_of_payment_select'), cell_width=12, action=cls.AjaxActions.SELECT, is_sorting=True
- ),
Add Comment
Please, Sign In to add comment