Skip to content

Instantly share code, notes, and snippets.

@femmerling
Created February 28, 2013 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femmerling/5054451 to your computer and use it in GitHub Desktop.
Save femmerling/5054451 to your computer and use it in GitHub Desktop.
Edit contacts routing
@app.route('/contact/view-all')
def contact_view_controller():
#this is the controller to view all data in the model
contact_list = Contact.query.all()
if contact_list:
contact_entries = [contact.dto() for contact in contact_list]
else:
contact_entries = None
return render_template('contact.html',contact_entries = contact_entries, title = "Contact List")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment