Skip to content

Instantly share code, notes, and snippets.

@kerin
Created December 5, 2013 14:40
Show Gist options
  • Save kerin/7806118 to your computer and use it in GitHub Desktop.
Save kerin/7806118 to your computer and use it in GitHub Desktop.
def get_twitter_panelist_by_pmxid(self, pmx_id):
with session_scope(self.db_session) as session:
try:
panelist = session.query(Panelists).filter_by(
medium='twitter',
pmxid=pmx_id).one()
except NoResultFound:
panelist = None
session.expunge_all()
return panelist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment