This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.filters import OrderingFilter | |
class CustomOrderFilter(OrderingFilter): | |
allowed_custom_filters = ['user_city', 'user_country'] | |
fields_related = { | |
'user_city': 'user__city__name', # ForeignKey Field lookup for ordering | |
'user_country': 'user__country__name' | |
} | |
def get_ordering(self, request, queryset, view): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import bs4 | |
import requests | |
def get_data(url): | |
res = requests.get(url) | |
res.raise_for_status() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import bs4 | |
import requests | |
def get_data(url): | |
res = requests.get(url) | |
res.raise_for_status() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
from functools import wraps | |
from django.contrib import messages | |
from django.shortcuts import redirect | |
def session_required(session_key, fail_redirect_to): | |
def _session_required(view_func): | |
@wraps(view_func) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<dos.h> | |
int Vari1,j,k,X_Axis=1,Count_Word,ch,Full_Clipboard,Y_Axis,More_Clipboard=1,Condition_Match,Is_Black_Shade,i,a,b,Shift_Clipboard,Count_Clipboard,Clipboard_No; | |
char *string; | |
char far *p; | |
char far *q; | |
char *Turbo[]= | |
{ | |
" F1 Help ³ Redraw the screen", |