def fetch_more_issues(request): """ [AJAX] Handles request to from a repository """ # Get OAuth tokens auth_tokens = bitauth.get_auth_tokens(request.user) repo_owner = request.GET['repo-owner'] repo_slug = request.GET['repo-slug'] repo_count = int(request.GET['count']) queries = {} queries['start'] = repo_count if 'filter-type' in request.GET: queries['kind'] = request.GET['filter-type'] if 'filter-status' in request.GET: queries['status'] = request.GET['filter-status'] # Grabs more deal, parses them, and renders template context html_data = bitissues.ajax_process_issues(auth_tokens, repo_owner, repo_slug, 10, queries) return HttpResponse(html_data)
def filter_issues_status(request): """ [AJAX] Grab issues that are filtered by status """ # Get query data from Ajax request auth_tokens = bitauth.get_auth_tokens(request.user) repo_owner = request.GET['repo-owner'] repo_slug = request.GET['repo-slug'] queries = {} if 'filter-status' in request.GET: queries['status'] = request.GET['filter-status'] if 'filter-type' in request.GET: queries['kind'] = request.GET['filter-type'] count = 10 if 'count' in request.GET: count = int(request.GET['count']) # Create request URL and get filtered issues by kind html_data = bitissues.ajax_process_issues(auth_tokens, repo_owner, repo_slug, count, queries) return HttpResponse(html_data)