Skip to content

Instantly share code, notes, and snippets.

Avatar

Esau Rodriguez esauro

View GitHub Profile
@esauro
esauro / row_selector.js
Created May 16, 2012
jQuery selector for table rows o table cols based on http://programanddesign.com/js/jquery-select-table-column-or-row/, modified to make row includes th
View row_selector.js
<script>
$.fn.row = function(i) {
return $('tr:nth-child('+(i+1)+') td, tr:nth-child('+(i+1)+') th', this);
}
$.fn.column = function(i) {
return $('tr td:nth-child('+(i+1)+')', this);
}
$('table').row(2).hide();
@esauro
esauro / admin_actions.py
Created Apr 25, 2012
Action to generate a json document with all objects and related objects
View admin_actions.py
# -*- coding: utf-8 -*-
__author__ = 'esauro'
from django.core import serializers
from django.db.models.deletion import Collector
from django.http import HttpResponse
from django.db import router
def export_related_as_json(modeladmin, request, qs):
"""Serializes the selected queryset and all related objects to JSON"""
You can’t perform that action at this time.