Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tmc on github.
  • I am tmc (https://keybase.io/tmc) on keybase.
  • I have the public key with fingerprint 8B24 C0E3 6A63 95BB 80DB  F378 A815 2998 72A2 287F

To claim this, I am signing this object:

iff --git a/contrib/comments/views/comments.py b/contrib/comments/views/comments.py
index 3279543..d991f0a 100644
--- a/contrib/comments/views/comments.py
+++ b/contrib/comments/views/comments.py
@@ -87,6 +87,10 @@ def post_comment(request, next=None):
# Otherwise create the comment
comment = form.get_comment_object()
comment.ip_address = request.META.get("REMOTE_ADDR", None)
+
+ if ',' in comment.ip_address:
diff --git a/contrib/admin/views/main.py b/contrib/admin/views/main.py
index 1051648..7c7385d 100644
--- a/contrib/admin/views/main.py
+++ b/contrib/admin/views/main.py
@@ -62,7 +62,7 @@ class ChangeList(object):
if ERROR_FLAG in self.params:
del self.params[ERROR_FLAG]
- self.order_field, self.order_type = self.get_ordering()
+ self.order_field, self.order_type = self.get_order_field_and_type()
/**
* Ubiquity commands to search mininova.org or thepiratebay.org
*/
var TorrentUbiquity = {};
TorrentUbiquity.MCM = {
'ANIME' : '1',
'BOOKS' : '2',
'GAMES' : '3',
'MOVIES' : '4',
'MUSIC' : '5',
#!/bin/sh
num=21 # 3 weeks
for h in albert; do
date=`date +%Y%m%d-%H%M%S`
dir=/home/backup/$h.d
manifest=$dir/manifest
# Find the most recent backup
touch $manifest
def comment_saved_handler(sender, instance, created, **kwargs):
"""
Signal handler to populated comment count fields.
Bound to 'comment_count' field, should probably be checking for a field annotation in the model.
"""
if 'comment_count' in [f.name for f in instance.content_object._meta.fields]:
instance.content_object.count = instance.content_object.comments.count()
instance.content_object.save()
from django.contrib.comments.models import Comment
From 03573a3876a39de5766082c3557b03e3e7134009 Mon Sep 17 00:00:00 2001
From: Travis Cline <travis.cline@gmail.com>
Date: Fri, 10 Apr 2009 15:13:35 -0500
Subject: [PATCH] added memoization of get_models for performance
---
django/db/models/loading.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/django/db/models/loading.py b/django/db/models/loading.py
--- modules/open-vm/modules/linux/vmhgfs/page.c.orig 2008-11-18 00:02:20.000000000 -0800
+++ modules/open-vm/modules/linux/vmhgfs/page.c 2009-04-21 05:49:16.161729489 -0700
@@ -62,6 +62,15 @@
struct page *page,
unsigned pageFrom,
unsigned pageTo);
+static void HgfsDoWriteBegin(struct page *page,
+ unsigned pageFrom,
+ unsigned pageTo);
+static int HgfsDoWriteEnd(struct file *file,
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index 9312eab..719a57d 100644
--- a/django/contrib/admin/helpers.py
+++ b/django/contrib/admin/helpers.py
@@ -111,6 +111,7 @@ class InlineAdminFormSet(object):
def __iter__(self):
for form, original in zip(self.formset.initial_forms, self.formset.get_queryset()):
+ print original
yield InlineAdminForm(self.formset, form, self.fieldsets, self.opts.prepopulated_fields, original)
def rf_handler(sender, **kwargs):
import guppy
heapy = guppy.hpy()
h = heapy.heap()
print h
print h.byrcs
print 'xxxxxxxxxxx'
print h[0].byrcs
print h[1].byrcs