Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(12)  |  Derive(0)  |  Import(3)
Automatically creates a connection for Simon models.

src/f/l/Flask-Simon-0.3.0/examples/flaskr/flaskr.py   Flask-Simon(Download)
from flask import (Flask, request, session, redirect, url_for, abort,
                   render_template, flash)
from flask.ext.simon import Simon, Model
 
 
app = Flask(__name__)
app.config.from_object(__name__)
app.config.from_envvar('FLASKR_SETTINGS', silent=True)
Simon(app)

src/f/l/Flask-Simon-0.3.0/examples/flask-login/login.py   Flask-Simon(Download)
from flask import Flask, redirect, render_template, request, url_for
from flask.ext.login import (AnonymousUser, LoginManager, UserMixin,
                             login_required, login_user, logout_user)
from flask.ext.simon import Simon, Model
 
app = Flask(__name__)
app.secret_key = 'Keep this value secret'
Simon(app)

src/f/l/Flask-Simon-0.3.0/tests/test_simon.py   Flask-Simon(Download)
from bson.objectid import ObjectId
from flask import Flask
from flask.ext.simon import ObjectIDConverter, Simon, get_or_404
import mock
from pymongo.errors import InvalidURI
        with mock.patch.object(Simon, 'init_app') as init_app:
            # Simon.init_app() should not be called
            Simon()
 
            self.assertFalse(init_app.called)
 
        with mock.patch.object(Simon, 'init_app') as init_app:
            # Simon.init_app() should be called with self.app
            Simon(self.app, 'MONGODB', 'simon')
    def test_init_app(self):
        """Test the `init_app()` method."""
 
        simon = Simon()
        with mock.patch('simon.connection.connect') as connect:
        self.app.config['MONGO_URI'] = url
 
        simon = Simon()
        with self.assertRaises(InvalidURI):
            simon.init_app(self.app)