OMAR WEBDESIGN

WELCOME TO OMAR COMPANY  

Headlines

NEW INNOVATION full story...

PHP full story...

JAVA full story...

PYTHON full story...

VBS full story...

SCRIPT full story...

Designing a tasklist application

Designing an applicati on should start with a clear idea of what is expected. Not only to determine what is technically required, but almost as important, to defi ne clear boundaries so that we don't lose ti me on things that are just nice to have. Nice to have features are something to be added if there is ti me left  in the project. So let's draw up a shortlist of the relevant features of our tasklist applicati on. Some of these may seem obvious, but as we will see, these have a direct impact on some implementati on choices that we have to make, such as:

    • T he applicati on will be used by multi ple users
    • Task lists should be stored indefi nitely
    • A task list may contain an unlimited number of tasks but the user interface is designed for opti mal performance for up to 25 tasks or so
    • Tasks may be added, deleted, and marked as done

Time for action – creating a logon screen

import cherrypy import

logon class Root(object):
 logon = logon.Logon(path="/logon",                        authenticated="/",                        not_authenticated="/goaway")
 
 @cherrypy.expose  def index(self):      username=logon.checkauth('/logon')       return '''
        <html><body>
        <p>Hello user <b>%s</b></p>
        </body></html>'''%username
 
 @cherrypy.expose  def goaway(self):
    return '''
      <html>
      <body><h1>Not authenticated, please go away.</h1>
      </body></html>'''
 @cherrypy.expose  def somepage(self):      username=logon.checkauth('/logon',returntopage=True)          return '''<html>
               <body><h1>This is some page.</h1>
               </body>
               </html>'''
             
if __name__ == "__main__":
 import os.path  current_dir = os.path.dirname(os.path.abspath(__file__))
 cherrypy.quickstart(Root(),config={
    '/': {'tools.sessions.on': True }
    }
    )


Next 1 2

About Us | Site Map | Privacy Policy | Contact Us | ©2014

omarwebdesign.netau.net


Free Web Hosting