Skip to content

Instantly share code, notes, and snippets.

@view_config(route_name='my-route')
def my_view(request):
# here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict?
if request.matched_route.name == 'my-route2':
# do extra work
config.add_route('my-route', '/path-1/view')
config.add_route('my-route2', '/path-2/view')
@binarymatt
binarymatt / field.py
Created November 28, 2012 20:57 — forked from commadelimited/field.py
Widget form field
trial_length = forms.IntegerField(widget=forms.TextInput(attrs={'size': '3', 'maxlength': '2'}), label='Number of days in Trial period', required=False)
@binarymatt
binarymatt / gist:1827430
Created February 14, 2012 15:06 — forked from briandailey/dev.md
Stratasan Developer Description

Who We Are

Stratasan is a Nashville-based startup in the healthcare sector that provides reporting tools that derive market intelligence from both public and private healthcare data. For example, we provide reports that show past and future market utilization (e.g., how many patients are expected to have heart problems in zip code 11105?), charges and costs, quality measures, etc.

Why You Should Talk To Us

  • We are a startup in the early stages of growth, so your skills and input will have an impact on the company itself (for good or for evil).
  • All of our products are on the open-source stack (Python/Django/Postgres/PostGIS), rare in healthcare.
  • We do some really neat things with GIS (mapping), if you're into that.
  • We concentrate on data (warehousing, analyzing, summarizing, etc), a burgeoning field.
@binarymatt
binarymatt / manage_fabric.py
Created October 31, 2011 03:03 — forked from bradmontgomery/manage_fabric.py
A stab at running remote Django management commands via fabric.
def manage(management_command, args=[]):
with cd(REMOTE_PROJECT_DIR):
with prefix('source /path/to/virtualenv/bin/activate'):
run('python manage.py %s %s' % (management_command, ' '.join(args))
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import shutil
import subprocess
import sys
import tempfile