Created
July 2, 2014 14:26
-
-
Save horiajurcut/4bbea1c1fb638ea23d01 to your computer and use it in GitHub Desktop.
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 flask.ext.classy import route | |
class ModelView(BaseView): | |
@route('/<int:entity_id>') | |
@route('/<int:entity_id>/<string:relationship>') | |
def get(self, entity_id, relationship=None): | |
# Available routes will be: | |
# http://domain.com/<prefix>/<model_view_subclass>/<id> | |
# http://domain.com/<prefix>/<model_view_subclass>/<id>/<relationship> | |
# model_view_subclass: if class is BookmarksView => model_view_subclass = 'bookmarks' | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment