Skip to content

Instantly share code, notes, and snippets.

View jbaldivieso's full-sized avatar

Jon Baldivieso jbaldivieso

  • SPOON
  • Portland, OR
View GitHub Profile
@jbaldivieso
jbaldivieso / forms.py
Created February 12, 2016 23:12
Django code to make a multi-checkbox widget that works with Django's Postgres-based ArrayField
from django import forms
from django.forms import widgets
DELIMITER = ','
class MultiCheckboxChoiceInput(widgets.CheckboxChoiceInput):
def __init__(self, *args, **kwargs):
@jbaldivieso
jbaldivieso / gist:4515013
Created January 11, 2013 23:53
Zip codes for big cities
CITIES = [
# "newyork":
"10453", "10457", "10460", "10458", "10467", "10468", "10451",
"10452", "10456", "10454", "10455", "10459", "10474", "10463", "10471",
"10466", "10469", "10470", "10475", "10461", "10462", "10464", "10465",
"10472", "10473", "11212", "11213", "11216", "11233", "11238", "11209",
"11214", "11228", "11204", "11218", "11219", "11230", "11234", "11236",
"11239", "11223", "11224", "11229", "11235", "11201", "11205", "11215",
"11217", "11231", "11203", "11210", "11225", "11226", "11207", "11208",
"11211", "11222", "11220", "11232", "11206", "11221", "11237", "10026",