Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. from flask import Blueprint, render_template, current_app
  4. from flaskext.mongokit import MongoKit
  5.  
  6. from app.models.mongodb import Ref
  7.  
  8. bp = Blueprint('references', __name__)
  9.  
  10. #------------------------------------------------------------------------------
  11. @bp.route('/')
  12. def index():
  13.     context = {}
  14.  
  15.     db = MongoKit(current_app)
  16.     db.register([Ref])
  17.  
  18.     context['refs'] = db.Ref.find()
  19.  
  20.     return render_template('refs.html', c=context)
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement