Skip to content

Instantly share code, notes, and snippets.

@lgyanf
lgyanf / main.py
Last active October 13, 2016 21:58
from sentry import report_error
@report_error
def main():
raise ValueError('test')
@lgyanf
lgyanf / add_query_parameters.py
Created June 14, 2016 10:49
A python decorator that adds query parameters to django-rest-framework swagger docstring.
# -*- coding: utf-8 -*-
import collections
import yaml
from rest_framework import fields
"""
Convert rest_framework.fields classes to Swagger data types according to http://swagger.io/specification/
Return 'string' by default.