This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import morepath | |
| from reg import match_key | |
| class App(morepath.App): | |
| @morepath.dispatch_method(match_key('name')) | |
| def service(self, name): | |
| raise NotImplementedError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import morepath | |
| from pymitter import EventEmitter | |
| class App(morepath.App): | |
| ee = EventEmitter() | |
| @App.ee.on('myevent') | |
| def handler1(arg, request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from .app import App | |
| from .db import get_dbsession | |
| from .models import User | |
| @App.method(App.dbsession) | |
| def app_dbsession(app): | |
| return get_dbsession(app.settings.sqlalchemy.__dict__) | |
OlderNewer