Changeset 2925

Show
Ignore:
Timestamp:
02/20/07 23:26:45 (2 years ago)
Author:
mscott
Message:

do not show lists of queries and transactions, just link to where we can get those lists

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/routing.py

    r2916 r2925  
    2020     
    2121    map.resource('database', 'databases') 
    22     map.resource('extent', 'extents', path_prefix='/databases/:db_id') 
    2322     
     23    map.resource('extent', 'extents', 
     24                 path_prefix='/databases/:db_id') 
     25     
     26    map.resource('query', 'queries', 
     27                 path_prefix='/databases/:db_id/extents/:extent_id', 
     28                 name_prefix='extent_') 
     29     
     30    map.resource('transaction', 'transactions', 
     31                 path_prefix='/databases/:db_id/extents/:extent_id', 
     32                 name_prefix='extent_') 
     33 
    2434    map.connect(':controller/:action/:id') 
    2535    map.connect('*url', controller='template', action='view') 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extents.py

    r2922 r2925  
    6363        c.extent_len = len(extent) 
    6464        c.extent_name = extent.name 
    65         c.transactions = transactions = [] 
    66         for tx_name in list(extent.t): 
    67             tx_url = '#'        # XXX: make real 
    68             tx_method = extent.t[tx_name] 
    69             tx_label = label(tx_method) 
    70             transactions.append((tx_label, tx_url)) 
    71         c.queries = queries = [] 
    72         for q_name in list(extent.q): 
    73             q_url = '#'         # XXX: make real 
    74             q_method = extent.q[q_name] 
    75             q_label = label(q_method) 
    76             queries.append((q_label, q_url)) 
     65        c.queries_url = h.url_for('extent_queries', db_id=db_id, extent_id=id) 
     66        c.transactions_url = h.url_for( 
     67            'extent_transactions', db_id=db_id, extent_id=id) 
    7768        return render_response('extents.show') 
    7869     
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html

    r2922 r2925  
    2424                        <dd>${c.extent_len}</dd> 
    2525                </dl> 
    26                  
    27                 <h2>Query Methods</h2> 
    28                  
     26 
    2927                <ul> 
    30                         <li py:for="q_label, q_url in c.queries"
    31                                 <a href="${q_url}">${q_label}</a> 
     28                        <li
     29                                <a href="${c.queries_url}">Queries</a> 
    3230                        </li> 
    33                 </ul> 
    34                  
    35                 <h2>Transaction Methods</h2> 
    36                  
    37                 <ul> 
    38                         <li py:for="tx_label, tx_url in c.transactions"> 
    39                                 <a href="${tx_url}">${tx_label}</a> 
     31                         
     32                        <li> 
     33                            <a href="${c.transactions_url}">Transactions</a> 
    4034                        </li> 
    4135                </ul> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extents.py

    r2922 r2925  
    1414        assert 'Foos' in response       # plural label 
    1515        assert '0' in response          # length 
    16         assert 'Query Methods' in response 
    17         assert 'By Example' in response 
    18         assert 'Exact Matches' in response 
    19         assert 'Transaction Methods' in response 
    20         assert 'Create' in response 
    21         # XXX: test transaction and query URLs 
     16        assert 'Queries' in response 
     17        assert url_for( 
     18            'extent_queries', db_id='db', extent_id='Foo') in response 
     19        assert 'Transactions' in response 
     20        assert url_for( 
     21            'extent_transactions', db_id='db', extent_id='Foo') in response 
     22