Skip to content

Instantly share code, notes, and snippets.

var Feed, FeedItem, FeedItems, Feeds,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Feeds = (function(_super) {
__extends(Feeds, _super);
@davidmarble
davidmarble / patch_model.py
Created November 28, 2011 21:02
Monkey patch django built-in models so that any fields can be overwritten or added
from django.db.models.fields import Field
import types
def patch_model(model_to_patch, class_to_patch_with):
"""
Adapted from http://www.ravelsoft.com/blog/2010/patchmodel-hacky-solution-extending-authuser-class
Monkey patch a django model with additional or replacement fields and methods.
All fields and methods that didn't exist previously are added.
@davidmarble
davidmarble / django-utils.py
Created September 23, 2011 03:06
Some utility functions for django projects
"""
Some utilities for django projects
A few others:
https://github.com/andymccurdy/django-tips-and-tricks/blob/master/model_update.py
https://bitbucket.org/weholt/dse2
"""
import sys, os, string, random