3: Class and Method Bridge

< Previous Step Next Step >


The functional centers are expressed in the form of methods and classes. Most are handlers of web requests, which are characterized by types of pages or sections of pages. 


Note that for pages with more than one state, we create a render function, which will be the sole access point for the Django template for that page, used by all the handler classes associated with that page (getting the forms, posting the forms, etc).

Note that pass is used to provide a statement for an empty Python function.

# splash page

class SplashPage:
def get():
pass


# login / logout pages class LoginPage: def get(): pass class LogoutPage: def get(): pass
# user page def user_page_render(): # access to user_page.html django template pass class UserPage: def get(): pass class CreateGroup(): def get(): pass
# admin page def admin_page_render(): # access to admin_page.html django template pass class AdminPage: def get(): pass
# group page def group_page_render(): # access to group_page.html django template pass class GroupPage: def get(): # state switch: user's membership in group pass class CreateGroup: def get(): pass class JoinGroup: def get(): pass class LeaveGroup: def get(): pass
# text sections class TextSectionAddEdit: def get(): # add - renders the home page with a # Text form, populateed on edit pass def post(): # add - handles the CGI POST to # add or update a Text section pass class TextSectionDelete: def get(): # delete - deletes a text section pass

Comments