Skip to content

Instantly share code, notes, and snippets.

Working from home

Pavel Katsev p7k

Working from home
View GitHub Profile
p7k /
Created Aug 4, 2011 — forked from juniorz/
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
View gist:945012
elif isinstance(value, (int, long)):
model = self.fk_resource._meta.object_class
obj = model.objects.get(pk=value)
except (model.DoesNotExist, model.MultipleObjectsReturned):
raise ApiFieldError("Could not find the provided object via PK '%s'." % value)
return self.fk_resource.full_dehydrate(obj)
View gist:838884
def parse_event(self, response):
# self.log('Hi, this is an event page! %s' % response.url)
hxs = HtmlXPathSelector(response)
event_view_div ='//div[@class="event_view"]')
event = Event()
event_loader = XPathItemLoader(event, event_view_div)