Created
January 27, 2015 09:41
-
-
Save justinfay/87017d868b2cdb0cfb18 to your computer and use it in GitHub Desktop.
This file contains 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
SQL_CREATE_POST = '' | |
SQL_RETRIEVE_POST = '' | |
SQL_UPDATE_POST = '' | |
SQL_DELETE_POST = '' | |
class Persistent(object): | |
# Implements persistence logic using dbkit. | |
pass | |
def http_endpoint(route, template): | |
# Decorator for registering http endpoints. | |
pass | |
def json_endpoint(route): | |
# Decorator for registering rest style json enpoints. | |
pass | |
@json_endpoint('/api/post/') | |
@http_endpoint('/post/', 'post.html') | |
class Post(Persistent): | |
# These class variable map to HTTP methods if desired. | |
create = SQL_CREATE_POST | |
retrieve = SQL_RETRIEVE_POST | |
update = SQL_UPDATE_POST | |
delete = SQL_DELETE_POST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment