Skip to content

Instantly share code, notes, and snippets.

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})
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());