Changeset 2930

Show
Ignore:
Timestamp:
02/21/07 13:08:12 (2 years ago)
Author:
mscott
Message:

List of available extent queries

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_queries.py

    r2928 r2930  
    88    #     map.resource('extent_query', 'extent_queries') 
    99 
    10     def index(self, format='html'): 
     10    def index(self, db_id, extent_id, format='html'): 
    1111        """GET /: All items in the collection.""" 
    1212        # url_for('extent_queries') 
    13         pass 
     13        c.dbs = dbs = self.dbs 
     14        c.db_id = db_id 
     15        c.db = db = dbs[db_id] 
     16        c.extent = db.extent(extent_id) 
     17        return render_response('/extent_queries/index.html') 
    1418     
    1519    def create(self): 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_transactions.py

    r2926 r2930  
    11from schevopylonsnav.lib.base import * 
     2 
    23 
    34class ExtentTransactionsController(BaseController): 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_queries/index.html

    r2928 r2930  
    11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    2 <html xmlns="http://www.w3.org/1999/xhtml"  
    3       xmlns:py="http://genshi.edgewall.org/" 
    4       xmlns:xi="http://www.w3.org/2001/XInclude"> 
    5 <xi:include href="../master.html"></xi:include> 
     2<html> 
    63    <head> 
    7         <title>${c.extent_plural} in ${c.db_label} -- Navigator</title> 
     4        <title> 
     5            Queries 
     6            &larr; 
     7            ${h.plural(c.extent)} 
     8            &larr; 
     9            Extents 
     10            &larr; 
     11            ${h.label(c.db)} 
     12            &larr; 
     13            Databases 
     14        </title> 
    815    </head> 
    916    <body> 
    1017        <div id="breadcrumbs"> 
    11             <a href="${c.databases_url}">Databases</a> 
     18            <a href="${h.url_for('databases')}">Databases</a> 
    1219            &rarr; 
    13             <a href="${c.db_url}">${c.db_label}</a> 
     20            <a href="${h.url_for('database', id=c.db_id)}">${h.label(c.db)}</a> 
    1421            &rarr; 
    15             <a href="${c.extents_url}">Extents</a> 
     22            <a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a> 
    1623            &rarr; 
    17             <a href="${c.extent_url}">${c.extent_plural}</a> 
     24            <a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 
     25                >${h.plural(c.extent)}</a> 
    1826            &rarr; 
    19             <a href="${h.url_for()}">Queries</a> 
     27            <a href="${h.url_for('extent_queries', db_id=c.db_id, extent_id=c.extent.name)}">Queries</a> 
    2028        </div> 
    2129         
     30                <ul> 
     31                    % for name in c.extent.q: 
     32                        <li> 
     33                            <a href="#">${h.label(c.extent.q[name])}</a> 
     34                        </li> 
     35                    % endfor 
     36                </ul> 
    2237    </body> 
    2338</html> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extent_queries.py

    r2926 r2930  
    11from schevopylonsnav.tests import * 
    22 
     3 
    34class TestExtentQueriesController(TestController): 
     5     
    46    def test_index(self): 
    5         pass 
    6         # response = self.app.get(url_for(controller='extent_queries')) 
    7         # Test response... 
     7        response = self.app.get( 
     8            url_for('extent_queries', db_id='db', extent_id='Foo')) 
     9        assert 'By Example' in response 
     10        assert 'Exact Matches' in response