Skip to content

Instantly share code, notes, and snippets.

View michaelkuty's full-sized avatar

Michael Kutý michaelkuty

View GitHub Profile
@michaelkuty
michaelkuty / tasks.py
Last active October 9, 2015 13:29
save output from celery tasks
import functools
import sys
from StringIO import StringIO
def catch_result(task_func):
"""Catch printed result from Celery Task and return it in task response
"""
@michaelkuty
michaelkuty / gist:57ac40950a77ab900336
Created August 21, 2014 20:58
horizon auto overrides
def auto_overrides(app):
module_name = "%s.%s" % (app, "overrides")
try:
mod = __import__(module_name)
except Exception, e:
pass
for app in settings.INSTALLED_APPS:
auto_overrides(app)
@michaelkuty
michaelkuty / Actions.py
Last active September 9, 2015 15:43
full implementation bootstrap pagination datatable for openstack horizon
class BaseFilterAction(tables.FilterAction):
"""filter action for search in all available columns
.. attribute:: custom_field
Custom field for search. Default is all fields.
"""
needs_preloading = True
@michaelkuty
michaelkuty / gist:6845607
Created October 5, 2013 20:23
simple add file to exist issue in redmine
import requests
import json
url = 'http://jachym-redmine.samsung.majklk.cz'
auth = {'key':'008e507cf5bffac1f5df822d8cb3465170813b09'}
#filename relative path
#issue=issue_id = String !!
#item {"name":"test.jpeg", "description":"","content-Type":"image/png"path:"/srv/jachym/bin/"}