Changeset 2715


Ignore:
Timestamp:
Dec 20, 2009, 9:47:11 PM (15 years ago)
Author:
broder
Message:

Document MachineView?.getattr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/main.py

    r2711 r2715  
    249249
    250250    class MachineView(View):
    251         # This is hairy. Fix when CherryPy 3.2 is out. (rename to
    252         # _cp_dispatch, and parse the argument as a list instead of
    253         # string
    254 
    255251        def __getattr__(self, name):
     252            """Synthesize attributes to allow RESTful URLs like
     253            /machine/13/info. This is hairy. CherryPy 3.2 adds a
     254            method called _cp_dispatch that allows you to explicitly
     255            handle URLs that can't be mapped, and it allows you to
     256            rewrite the path components and continue processing.
     257
     258            This function gets the next path component being resolved
     259            as a string. _cp_dispatch will get an array of strings
     260            representing any subsequent path components as well."""
     261
    256262            try:
    257263                cherrypy.request.params['machine_id'] = int(name)
Note: See TracChangeset for help on using the changeset viewer.