You will need Sija's version of the garb gem, so add this line to your Gemfile (you will need git installed for this):
gem 'garb', :git => 'git://github.com/Sija/garb.git'
Then run the gem bundler: bundle install
Set your google username
| setattr(self, field, getattr(utils, '%s%s' % (prefix, field))(self)) |
| # using lambdas | |
| def signed_in_both_chambers(self, **kwargs): | |
| signed = lambda a: 'Signed in the %s' % a | |
| return (self.filter(models.Q(bill_type='SB') | models.Q(bill_type='HB')) | |
| .filter(actions__description=signed('House')) | |
| .filter(actions__description=signed('Senate'))) | |
| # refactored into these methods | |
| def has_action(self, action): | |
| """Filter QuerySet by a given action""" |
| """ | |
| Quick script for scraping the current rankins from the GEN public choice | |
| awards. | |
| """ | |
| from pyquery import PyQuery as pq | |
| import requests | |
| URL = "https://app.wizehive.com/voting/dja2013/13447/%d" | |
| entries = [] |
| """ | |
| Script for bumping a Django version from one to the next minor version | |
| """ | |
| import os | |
| import sys | |
| import envoy | |
| def main(): |
| diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py | |
| index ae792a3..c18907c 100644 | |
| --- a/django/db/models/fields/related.py | |
| +++ b/django/db/models/fields/related.py | |
| @@ -595,7 +595,10 @@ def create_many_related_manager(superclass, rel): | |
| Returns the correct value for this relationship's foreign key. This | |
| might be something else than pk value when to_field is used. | |
| """ | |
| - fk = self.through._meta.get_field(field_name) | |
| + try: |
| [15:21:38] <knowtheory> that guy, sometimes more trouble than he's worth. | |
| [15:26:04] <tswicegood> knowtheory: lots of us programmer types are like that :-D | |
| [15:26:56] <knowtheory> tswicegood: yeah, figuring out ways to work constructively seems important | |
| [15:27:22] <tswicegood> not just important, imperative | |
| [15:27:59] <tswicegood> otherwise: http://j.mp/V9mRV4 :-/ | |
| [15:28:38] <knowtheory> Yeah the interesting part is that some issues in programming are ultimately ones of philosophy or perspective | |
| [15:28:56] <knowtheory> which are not technical issues to argue over, but ones that can only be hashed out by dealing with the intent of others | |
| [15:29:12] <knowtheory> and communicating that seems to be a challenge w/ some folks | |
| [15:29:29] <knowtheory> Yeah that thread is part of my diminished faith in humanity this week | |
| [15:29:43] <knowtheory> (although not for the reason that HN seemed to be pissed off) |
| . | |
| |____app | |
| |____build | |
| | |______init__.py | |
| | |______main__.py | |
| | |____convert.py | |
| | |____extract.py | |
| | |____retrieve.py | |
| | |____save.py | |
| |____data |
| # Add Current python path | |
| export PATH=/usr/local/Cellar/python/2.7.3/bin:$PATH | |
| export PATH=/usr/local/share/python:$PATH |
| { | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": true, | |
| "detect_indentation": false, | |
| "use_tab_stops": true | |
| } |