Skip to content

Instantly share code, notes, and snippets.

View pawlikowsky's full-sized avatar
🔧
Idea loading in progress

Mateusz Pawlikowski pawlikowsky

🔧
Idea loading in progress
View GitHub Profile
@pawlikowsky
pawlikowsky / generate_schema.py
Created February 15, 2020 12:24 — forked from Nicarim/generate_schema.py
Generator of swagger schematics based on common sense.
from inspect import isclass
from os.path import dirname, join
import django
import oyaml as yaml
from django.conf import settings
from django.core.exceptions import ViewDoesNotExist
from django.core.management import BaseCommand
from django.urls import URLPattern, URLResolver
from rest_framework import serializers
@pawlikowsky
pawlikowsky / python_decorator_guide.md
Created May 19, 2018 14:35 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].