Changeset 2915

Show
Ignore:
Timestamp:
02/20/07 17:42:42 (2 years ago)
Author:
mscott
Message:

List open databases

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/mscott/SchevoPylonsNav/trunk

    • Property svn:ignore changed from
      *.db
      build
      dist
      to
      *.db
      build
      dist
      data
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/routing.py

    r2905 r2915  
    1818    # so they may take precedent over the more generic routes. For more information, refer 
    1919    # to the routes manual @ http://routes.groovie.org/docs/ 
     20     
     21    map.resource('database', 'databases') 
     22     
    2023    map.connect(':controller/:action/:id') 
    2124    map.connect('*url', controller='template', action='view') 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/base.py

    r2905 r2915  
    2020        c.w = WidgetBunch() 
    2121        # Get Schevo database. 
    22         db = self.db = environ['schevo.db.db'] 
     22        self.dbs = environ['schevo.db'] 
    2323        return WSGIController.__call__(self, environ, start_response) 
    2424 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/public/index.html

    r2905 r2915  
    22   "http://www.w3.org/TR/html4/loose.dtd"> 
    33<html> 
    4 <head> 
    5   <title>Pylons Default Page</title> 
    6   <style> 
    7     body { background-color: #fff; color: #333; } 
    8  
    9     body, p { 
    10       font-family: verdana, arial, helvetica, sans-serif; 
    11       font-size:   12px; 
    12       line-height: 18px; 
    13     } 
    14     pre { 
    15       background-color: #eee; 
    16       padding: 10px; 
    17       font-size: 11px; 
    18       line-height: 13px; 
    19     } 
    20  
    21     a { color: #000; } 
    22     a:visited { color: #666; } 
    23     a:hover { color: #fff; background-color:#000; } 
    24   </style> 
    25 </head> 
     4        <head> 
     5                <title>Schevo Database Navigator</title> 
     6        </head> 
    267<body> 
    278 
    28 <h1>Welcome to your Pylons Web Application</h1> 
     9       <h1>Welcome to the Schevo Database navigator.</h1> 
    2910 
    30 <h2>Weren't expecting to see this page?</h2> 
     11        <p> 
     12                Start by browsing the <a href="databases/">available databases</a>. 
     13        </p> 
    3114 
    32 <p>The <tt>schevopylonsnav/public/</tt> directory is searched for static files 
    33  <i>before</i> your controllers are run. Remove this file (<tt>schevopylonsnav/public/index.html</tt>) 
    34   and edit the routes in <tt>schevopylonsnav/config/routing.py</tt> to point the 
    35   <a href="/">root path</a> to a 'hello' controller we'll create below: 
    36   <pre> map.connect('', controller='hello', action='index')</pre> 
    37 </p> 
    38  
    39 <h2>Getting Started</h2> 
    40 <p>You're now ready to start creating your own web application. To create a 'hello' controller, 
    41   run the following command in your project's root directory:  
    42 <pre> 
    43 SchevoPylonsNav$ paster controller hello 
    44 </pre> 
    45  
    46   This generates the following the following code in <tt>schevopylonsnav/controllers/hello.py</tt>: 
    47 <pre> 
    48 from schevopylonsnav.lib.base import * 
    49  
    50 class HelloController(BaseController): 
    51     def index(self): 
    52         # Return a rendered template 
    53         #   return render_response('/some/template.html') 
    54         # or, Return a response object 
    55         return Response('Hello World') 
    56 </pre> 
    57 </p> 
    58 <p>This controller simply prints out 'Hello World' to the browser. Pylons' default routes 
    59   automatically set up this controller to respond at the <a href="/hello">/hello</a> URL. 
    60   With the additional route described above, this controller will also respond at the 
    61   <a href="/">root path</a>. 
    62 </p> 
    63  
    64 <h3>Using a template</h3> 
    65 <p>To call a template and do something a little more complex, this following example 
    66    shows how to print out some request information from a Myghty template. 
    67 </p> 
    68 <p>Create a <tt>serverinfo.myt</tt> file in your project's <tt>schevopylonsnav/templates/</tt> 
    69   directory with the following contents: 
    70 </p>   
    71 <pre> 
    72 &lt;h2&gt; 
    73 Server info for &lt;% request.host %&gt; 
    74 &lt;/h2&gt; 
    75  
    76 &lt;p&gt; 
    77 The URL you called: &lt;% h.url_for() %&gt; 
    78 &lt;/p&gt; 
    79  
    80 &lt;p&gt; 
    81 The name you set: &lt;% c.name %&gt; 
    82 &lt;/p&gt; 
    83  
    84 &lt;p&gt;The server environment:&lt;br /&gt; 
    85 &lt;pre&gt;&lt;% c.pretty_environ %&gt;&lt;/pre&gt; 
    86 &lt;/p&gt; 
    87 </pre> 
    88  
    89 Then add the following to your 'hello' controller class: 
    90 <pre> 
    91     def serverinfo(self): 
    92         import cgi 
    93         import pprint 
    94         c.pretty_environ = cgi.escape(pprint.pformat(request.environ)) 
    95         c.name = 'The Black Knight' 
    96         return render_response('/serverinfo.myt') 
    97 </pre> 
    98  
    99 You can now view the page at: <tt><a href="/hello/serverinfo">/hello/serverinfo</a></tt> 
    100 </p> 
    10115</body> 
    10216</html> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/schema/schema_001.py

    r2905 r2915  
    1616##  
    1717##     _key(name) 
     18 
     19 
     20class Foo(E.Entity): 
     21     
     22    bar = f.unicode()