Skip to content

Instantly share code, notes, and snippets.

@pydanny
Created July 11, 2011 23:45
Show Gist options
  • Select an option

  • Save pydanny/1077069 to your computer and use it in GitHub Desktop.

Select an option

Save pydanny/1077069 to your computer and use it in GitHub Desktop.
from django.template import Context
from django.template.loader import get_template
def model_generator(model_names):
template = get_template('startcbv/models.py')
c = Context({'model_names': model_names})
return template.render(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment