Skip to content

Instantly share code, notes, and snippets.

@justinfay
Created January 27, 2015 09:41
Show Gist options
  • Save justinfay/87017d868b2cdb0cfb18 to your computer and use it in GitHub Desktop.
Save justinfay/87017d868b2cdb0cfb18 to your computer and use it in GitHub Desktop.
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