Skip to content

Instantly share code, notes, and snippets.

@uhop
uhop / admin.py
Created March 14, 2011 00:31
Adding Dojo's rich editor to Django's Admin.
# Example how to add rich editor capabilities to your models in admin.
from django.contrib.admin import site, ModelAdmin
import models
# we define our resources to add to admin pages
class CommonMedia:
js = (
'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
define("can", ["has"], function(has){
return {
has: function(test, callback){
// summary: doublepluscool has.js intergration
// example:
// can.has("array-forEach", function(ihas){
// if(ihas){
// // There is a native Array.prototype.forEach
// }
@onyxfish
onyxfish / Advice from #djangocon 2010 Django-in-Journalism open-session
Created September 9, 2010 17:31
Advice from #djangocon 2010 Django-in-Journalism open-session
Suggestions from the 11 hackers at the table:
* Use connection pooling (pgpool).
* Don't expect reporters to get excited until you can show them something. (Find a way to appeal to reporters interests.)
* Only update what's changed. (e.g. on election results: show changes, not raw numbers)
* Use the AP's "dbready" format for election results.
* Use CSV for everything.
* Use pdb with runserver for debugging.
* Beware circular imports when using Haystack.
* Make the case for building news apps with government data. (Niran will provide numbers showing that people look at it.)