This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--DROP SCHEMA IF EXISTS acs2018_5yr_extraction CASCADE; | |
CREATE SCHEMA acs2018_5yr_extraction; | |
CREATE TABLE acs2018_5yr_extraction.population__bg_tract_county AS ( | |
SELECT gh.sumlevel, CONCAT(state, county, tract, blkgrp) AS geoid, b01003001 AS population, stusab | |
FROM acs2018_5yr.geoheader gh | |
JOIN acs2018_5yr.b01003 b | |
ON gh.geoid = b.geoid | |
WHERE gh.sumlevel = 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
class GroupedModelChoiceField(forms.ModelChoiceField): | |
def optgroup_from_instance(self, obj): | |
return "" | |
def __choice_from_instance__(self, obj): | |
return (obj.id, self.label_from_instance(obj)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from TileStache import WSGITileServer, splitPathInfo | |
import re | |
# | |
# Decorator for the WSGITileServer that allows for custom tilestache configuration. | |
# | |
# Takes in a tilestache config file and a series of parameter names. Any that are present will be sent to the | |
# provider and the cache classes on each call. |