Skip to content

Instantly share code, notes, and snippets.

Avatar

Javier javierverb

View GitHub Profile
@javierverb
javierverb / .js
Created Oct 21, 2016
A simple and helpfull function for search in any element with the class searchable
View .js
(function() {
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr:visible').addClass('hide')
$('.searchable tr.hide').filter(function () {
return rex.test($(this).text());
}).removeClass('hide');
})
})();
View export_to_excel.py
def export_to_excel(request):
"""
This function is simple,
not require other libs
and work perfect
"""
obj = SomeObject.objects.all()
filename = 'data_exported.xls'
response = render_to_response('some_table_to_render.html',
{'obj': obj})
You can’t perform that action at this time.