def api(request, action: str = 'products'): """Апи-метод для получения всех данных""" if action == 'props': result = ApiHelper(request, props_vars, CUR_APP) elif action == 'pvalues': result = ApiHelper(request, pvalues_vars, CUR_APP) else: result = ApiHelper(request, products_vars, CUR_APP) return result
def api(request, action: str = 'spam_tables'): """Апи-метод для получения всех данных""" if action == 'spam_rows': result = ApiHelper(request, spam_rows_vars, CUR_APP) elif action == 'email_accounts': result = ApiHelper(request, email_accounts_vars, CUR_APP) elif action == 'black_list': result = ApiHelper(request, black_list_vars, CUR_APP) else: result = ApiHelper(request, spam_tables_vars, CUR_APP) return result
def api(request, action: str = 'rubrics'): """Апи-метод для получения всех данных""" if action == 'genres': result = ApiHelper(request, genres_vars, CUR_APP) elif action == 'events': result = ApiHelper(request, events_vars, CUR_APP) elif action == 'places': result = ApiHelper(request, places_vars, CUR_APP) elif action == 'seances': result = ApiHelper(request, seances_vars, CUR_APP) else: result = ApiHelper(request, rubrics_vars, CUR_APP) return result
def api(request, action: str = 'robots'): """Апи-метод для получения всех данных :param request: HttpRequest :param action: к какой модели обращаемся """ if action == 'test_scenarios': result = ApiHelper(request, test_scenarios_vars, CUR_APP) elif action == 'search_queries': result = ApiHelper(request, search_queries_vars, CUR_APP) elif action == 'sites': result = ApiHelper(request, sites_vars, CUR_APP) else: result = ApiHelper(request, robots_vars, CUR_APP) return result
def api(request, action: str = 'contractors'): """Апи-метод для получения всех данных :param request: HttpRequest :param action: к какой модели обращаемся """ #if action == 'contractors': # result = ApiHelper(request, contractors_vars, CUR_APP) result = ApiHelper(request, contractors_vars, CUR_APP) return result
def api(request, action: str = 'redirects'): """Апи-метод для получения всех данных""" if action == 'phones_white_list': result = ApiHelper(request, phones_white_list_vars, CUR_APP) elif action == 'cdr_csv': restrictions = [] app_label = cdrcsv_vars['model']._meta.app_label model_name = cdrcsv_vars['model']._meta.model_name if not request.user.has_perm('%s.view_%s' % (app_label, model_name)): personal_user_id = request.headers.get('token', 0) restrictions.append(Q(personal_user_id=personal_user_id)) result = ApiHelper(request, cdrcsv_vars, CUR_APP, restrictions=restrictions) else: result = ApiHelper(request, redirects_vars, CUR_APP) return result
def api(request, action: str = 'daemon'): """Апи-метод для получения всех данных""" #if action == 'daemon': # result = ApiHelper(request, daemon_vars, CUR_APP) result = ApiHelper(request, daemon_vars, CUR_APP) return result
def api(request, action: str = 'binary_com'): """Апи-метод для получения всех данных""" #if action == 'binary_com': # result = ApiHelper(request, binary_com_vars, CUR_APP) result = ApiHelper(request, binary_com_vars, CUR_APP) return result
def api(request, action: str = 'languages'): """Апи-метод для получения всех данных""" #if action == 'languages': # result = ApiHelper(request, languages_vars, CUR_APP) result = ApiHelper(request, languages_vars, CUR_APP) return result
def api(request, action: str = 'flattooltip'): """Апи-метод для получения всех данных""" #if action == 'flattooltip': # result = ApiHelper(request, flattooltip_vars, CUR_APP) result = ApiHelper(request, flattooltip_vars, CUR_APP) return result