Skip to content

Commit

Permalink
update the alchemy template to use pyramid version and doc version
Browse files Browse the repository at this point in the history
  • Loading branch information
goodwillcoding committed Apr 16, 2014
1 parent 0eff663 commit 23b5311
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<div class="row">
<div class="links">
<ul>
<li class="current-version">Currently v1.5</li>
<li><i class="glyphicon glyphicon-bookmark icon-muted"></i><a href="http://docs.pylonsproject.org">Docs</a></li>
<li class="current-version">Currently v${pyramid_version}</li>
<li><i class="glyphicon glyphicon-bookmark icon-muted"></i><a href="http://docs.pylonsproject.org/projects/pyramid/en/${pyramid_docs_branch}/">Docs</a></li>
<li><i class="glyphicon glyphicon-cog icon-muted"></i><a href="https://github.com/Pylons/pyramid">Github Project</a></li>
<li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="irc://irc.freenode.net#pyramid">IRC Channel</a></li>
<li><i class="glyphicon glyphicon-home icon-muted"></i><a href="http://pylonsproject.org">Pylons Project</a></li>
Expand Down
9 changes: 7 additions & 2 deletions pyramid/scaffolds/alchemy/+package+/views.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ def my_view(request):
one = DBSession.query(MyModel).filter(MyModel.name == 'one').first()
except DBAPIError:
return Response(conn_err_msg, content_type='text/plain', status_int=500)
return {'one': one, 'project': '{{project}}'}
return {
'one': one,
'project': '{{project}}',
'pyramid_version': '{{pyramid_version}}',
'pyramid_docs_branch': '{{pyramid_docs_branch}}'}


conn_err_msg = """\
Pyramid is having a problem using your SQL database. The problem
might be caused by one of the following things:

1. You may need to run the "initialize_{{project}}_db" script
to initialize your database tables. Check your virtual
to initialize your database tables. Check your virtual
environment's "bin" directory for this script and try to run it.

2. Your database server may not be running. Check that the
Expand Down

0 comments on commit 23b5311

Please sign in to comment.