Skip to content

Instantly share code, notes, and snippets.

View jezdez's full-sized avatar
🚴
💨

Jannis Leidel jezdez

🚴
💨
View GitHub Profile
@jezdez
jezdez / djpatch.py
Created August 25, 2011 10:21
A helper script to apply patches from Django's trac
#!/usr/bin/env python
"""
Obviously this is only useful if you have to deal with Django's
Trac a lot.
Mostly stolen from Jacob Kaplan-Moss, but improved by Jannis Leidel
and Aymeric Augustin.
Reads a config file at ~/.djpatchrc, e.g.:
@jezdez
jezdez / gloss.py
Created August 24, 2011 10:10
A dictionary like object that supports attribute access, too.
import copy
class gloss(dict):
"""
A dictionary like object that supports attribute access, too.
>>> import pickle
>>> s = gloss(a=123)
>>> c = s.copy()
@jezdez
jezdez / textmate-missingdrawer.installer.sh
Created August 17, 2011 13:31
The installer for the Missing Drawer plugin
#!/bin/sh
curl -s -L https://github.com/downloads/jezdez/textmate-missingdrawer/MissingDrawer-0.4.0.tmplugin.tgz | tar -xzf - && open MissingDrawer.tmplugin
diff --git a/tests/runtests.py b/tests/runtests.py
index f373309..6d4f282 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -1,5 +1,9 @@
#!/usr/bin/env python
-import os, subprocess, sys
+import os
+import shutil
+import subprocess
diff --git a/tests/runtests.py b/tests/runtests.py
index f373309..2c7c76f 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
-import os, subprocess, sys
+import os
+import subprocess
+import sys
# ...
def custom_show_toolbar(request):
return True # Always show toolbar, for example purposes only.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt
index 14f1900..9d19acc 100644
--- a/docs/topics/http/sessions.txt
+++ b/docs/topics/http/sessions.txt
@@ -95,8 +95,8 @@ defaults to output from ``tempfile.gettempdir()``, most likely ``/tmp``) to
control where Django stores session files. Be sure to check that your Web
server has permissions to read and write to this location.
-Using cookies-based sessions
-----------------------------
@jezdez
jezdez / postgres-memory
Created June 14, 2011 10:26
A script to start a Homebrew postgres in memory (needs lunchy to automatically stop the global postgres instance, gem install lunchy)
#!/bin/bash
# get lunchy: gem install lunchy
lunchy stop postgres
# Run this script to enable the Ramdisk for Postgres
VolumeName="postgres-memory"
# Size in MB, make sure is not too low or not too high
SizeInMB=2048
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 91ecbf2..18e62ef 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -928,6 +928,11 @@ class IPAddressField(Field):
kwargs['max_length'] = 15
Field.__init__(self, *args, **kwargs)
+ def get_db_prep_value(self, value, connection, prepared=False):
+ if not prepared:
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 94a9b65..91ecbf2 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -910,6 +910,7 @@ class BigIntegerField(IntegerField):
empty_strings_allowed = False
description = _("Big (8 byte) integer")
MAX_BIGINT = 9223372036854775807
+
def get_internal_type(self):