Changeset 2973
- Timestamp:
- 02/24/07 22:05:35 (2 years ago)
- Files:
-
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/routing.py (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/entity_t_methods.py (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/helpers.py (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/index.html (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/show.html (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/entities/show.html (modified) (4 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/entity_t_methods (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/entity_t_methods/__init__.py (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/entity_t_methods/index.html (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_q_methods/index.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_q_methods/show.html (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_t_methods/index.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_t_methods/show.html (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/index.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/edit.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/show.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/transactions/edit.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/transactions/show.html (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_entity_t_methods.py (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extents.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/routing.py
r2958 r2973 34 34 ) 35 35 36 map.resource('entity', 'entities',37 path_prefix='/databases/:db_id/extents/:extent_id',38 )39 40 36 map.resource('q_method', 'q_methods', 41 37 controller='extent_q_methods', … … 52 48 ) 53 49 50 map.resource('entity', 'entities', 51 path_prefix='/databases/:db_id/extents/:extent_id', 52 ) 53 54 map.resource('t_method', 't_methods', 55 controller='entity_t_methods', 56 path_prefix='/databases/:db_id/extents/:extent_id/entities/:entity_id', 57 name_prefix='entity_', 58 member=dict(call='POST'), 59 ) 60 54 61 map.connect(':controller/:action/:id') 55 62 map.connect('*url', controller='template', action='view') sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/helpers.py
r2929 r2973 10 10 from schevo.label import label, plural 11 11 12 from mako.filters import html_escape 12 13 13 # from toscawidgets.widgets.forms import HiddenField 14 # 15 # 16 # # Widgets for placement inside REST-style PUT and DELETE forms. 17 # DELETE = HiddenField('_method', default='DELETE') 18 # PUT = HiddenField('_method', default='PUT') 14 15 def hlabel(obj): 16 return html_escape(label(obj)) 17 18 19 def hplural(obj): 20 return html_escape(plural(obj)) sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/index.html
r2971 r2973 15 15 % for db_id, db in c.dbs.iteritems(): 16 16 <li> 17 <a href="${h.url_for('database', id=db_id)}">${h. label(db)}</a>17 <a href="${h.url_for('database', id=db_id)}">${h.hlabel(db)}</a> 18 18 </li> 19 19 % endfor sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/show.html
r2944 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.db)}4 ${h.hlabel(c.db)} 5 5 ← 6 6 Databases … … 10 10 <ul> 11 11 <li><a href="${h.url_for('databases')}">Databases</a></li> 12 <li class="here"><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>12 <li class="here"><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 13 13 </ul> 14 14 </%def> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/entities/show.html
r2972 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.entity)}4 ${h.hlabel(c.entity)} 5 5 ← 6 6 Entities 7 7 ← 8 ${h. plural(c.extent)}8 ${h.hplural(c.extent)} 9 9 ← 10 10 Extents 11 11 ← 12 ${h. label(c.db)}12 ${h.hlabel(c.db)} 13 13 ← 14 14 Databases … … 18 18 <ul> 19 19 <li><a href="${h.url_for('databases')}">Databases</a></li> 20 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>20 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 21 21 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 22 22 <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 23 >${h. plural(c.extent)}</a></li>23 >${h.hplural(c.extent)}</a></li> 24 24 <li><a href="${h.url_for('entities', db_id=c.db_id, extent_id=c.extent.name)}" 25 25 >Entities</a></li> 26 26 <li class="here"><a href="${h.url_for('entity', db_id=c.db_id, extent_id=c.extent.name, id=c.entity.sys.oid)}" 27 >${h. label(c.entity) | h}</a></li>27 >${h.hlabel(c.entity)}</a></li> 28 28 </ul> 29 29 </%def> … … 34 34 <li> 35 35 <label for="${name}"> 36 ${h. label(field)}36 ${h.hlabel(field)} 37 37 </label> 38 38 <span id="${name}" class="value"> … … 43 43 </ul> 44 44 </%def> 45 46 <%def name="children()"> 47 <ul> 48 <li><a href="${h.url_for('entity_t_methods', db_id=c.db_id, extent_id=c.extent_id, entity_id=c.entity.sys.oid)}" 49 >Transaction Methods</a></li> 50 </ul> 51 </%def> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_q_methods/index.html
r2970 r2973 4 4 Query Methods 5 5 ← 6 ${h. plural(c.extent)}6 ${h.hplural(c.extent)} 7 7 ← 8 8 Extents 9 9 ← 10 ${h. label(c.db)}10 ${h.hlabel(c.db)} 11 11 ← 12 12 Databases … … 16 16 <ul> 17 17 <li><a href="${h.url_for('databases')}">Databases</a></li> 18 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>18 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 19 19 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 20 20 <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 21 >${h. plural(c.extent)}</a></li>21 >${h.hplural(c.extent)}</a></li> 22 22 <li class="here"><a href="${h.url_for('extent_q_methods', db_id=c.db_id, extent_id=c.extent.name)}" 23 23 >Query Methods</a></li> … … 30 30 <li> 31 31 <a href="${h.url_for('extent_q_method', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 32 >${h. label(c.extent.q[name])}</a>32 >${h.hlabel(c.extent.q[name])}</a> 33 33 </li> 34 34 % endfor sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_q_methods/show.html
r2970 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.method)}4 ${h.hlabel(c.method)} 5 5 ← 6 6 Query Methods 7 7 ← 8 ${h. plural(c.extent)}8 ${h.hplural(c.extent)} 9 9 ← 10 10 Extents 11 11 ← 12 ${h. label(c.db)}12 ${h.hlabel(c.db)} 13 13 ← 14 14 Databases … … 18 18 <ul> 19 19 <li><a href="${h.url_for('databases')}">Databases</a></li> 20 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>20 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 21 21 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 22 22 <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 23 >${h. plural(c.extent)}</a></li>23 >${h.hplural(c.extent)}</a></li> 24 24 <li><a href="${h.url_for('extent_q_methods', db_id=c.db_id, extent_id=c.extent.name)}" 25 25 >Query Methods</a></li> 26 26 <li class="here"><a href="${h.url_for('extent_q_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 27 >${h. label(c.method)}</a></li>27 >${h.hlabel(c.method)}</a></li> 28 28 </ul> 29 29 </%def> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_t_methods/index.html
r2970 r2973 4 4 Transaction Methods 5 5 ← 6 ${h. plural(c.extent)}6 ${h.hplural(c.extent)} 7 7 ← 8 8 Extents 9 9 ← 10 ${h. label(c.db)}10 ${h.hlabel(c.db)} 11 11 ← 12 12 Databases … … 16 16 <ul> 17 17 <li><a href="${h.url_for('databases')}">Databases</a></li> 18 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>18 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 19 19 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 20 20 <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 21 >${h. plural(c.extent)}</a></li>21 >${h.hplural(c.extent)}</a></li> 22 22 <li class="here"><a href="${h.url_for('extent_t_methods', db_id=c.db_id, extent_id=c.extent.name)}" 23 23 >Transaction Methods</a></li> … … 30 30 <li> 31 31 <a href="${h.url_for('extent_t_method', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 32 >${h. label(c.extent.t[name])}</a>32 >${h.hlabel(c.extent.t[name])}</a> 33 33 </li> 34 34 % endfor sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_t_methods/show.html
r2970 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.method)}4 ${h.hlabel(c.method)} 5 5 ← 6 6 Transaction Methods 7 7 ← 8 ${h. plural(c.extent)}8 ${h.hplural(c.extent)} 9 9 ← 10 10 Extents 11 11 ← 12 ${h. label(c.db)}12 ${h.hlabel(c.db)} 13 13 ← 14 14 Databases … … 18 18 <ul> 19 19 <li><a href="${h.url_for('databases')}">Databases</a></li> 20 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>20 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 21 21 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 22 22 <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 23 >${h. plural(c.extent)}</a></li>23 >${h.hplural(c.extent)}</a></li> 24 24 <li><a href="${h.url_for('extent_t_methods', db_id=c.db_id, extent_id=c.extent.name)}" 25 25 >Transaction Methods</a></li> 26 26 <li class="here"><a href="${h.url_for('extent_t_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 27 >${h. label(c.method)}</a></li>27 >${h.hlabel(c.method)}</a></li> 28 28 </ul> 29 29 </%def> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/index.html
r2944 r2973 4 4 Extents 5 5 ← 6 ${h. label(c.db)}6 ${h.hlabel(c.db)} 7 7 ← 8 8 Databases … … 12 12 <ul> 13 13 <li><a href="${h.url_for('databases')}">Databases</a></li> 14 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>14 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 15 15 <li class="here"><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 16 16 </ul> … … 22 22 <li> 23 23 <a href="${h.url_for('extent', db_id=c.db_id, id=extent.name)}" 24 >${h. plural(extent)}</a>24 >${h.hplural(extent)}</a> 25 25 </li> 26 26 % endfor sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html
r2972 r2973 2 2 3 3 <%def name="title()"> 4 ${h. plural(c.extent)}4 ${h.hplural(c.extent)} 5 5 ← 6 6 Extents 7 7 ← 8 ${h. label(c.db)}8 ${h.hlabel(c.db)} 9 9 ← 10 10 Databases … … 14 14 <ul> 15 15 <li><a href="${h.url_for('databases')}">Databases</a></li> 16 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>16 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 17 17 <li><a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a></li> 18 18 <li class="here"><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 19 >${h. plural(c.extent)}</a></li>19 >${h.hplural(c.extent)}</a></li> 20 20 </ul> 21 21 </%def> … … 30 30 <li> 31 31 <label for="extent_label">Label</label> 32 <span class="value" id="extent_label">${h. label(c.extent)}</span>32 <span class="value" id="extent_label">${h.hlabel(c.extent)}</span> 33 33 </li> 34 34 35 35 <li> 36 36 <label for="extent_plural">Plural label</label> 37 <span class="value" id="extent_plural">${h. plural(c.extent)}</span>37 <span class="value" id="extent_plural">${h.hplural(c.extent)}</span> 38 38 </li> 39 39 sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/edit.html
r2970 r2973 4 4 Edit 5 5 ← 6 ${h. label(c.query)}6 ${h.hlabel(c.query)} 7 7 ← 8 8 Queries 9 9 ← 10 ${h. label(c.db)}10 ${h.hlabel(c.db)} 11 11 ← 12 12 Databases … … 16 16 <ul> 17 17 <li><a href="${h.url_for('databases')}">Databases</a></li> 18 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>18 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 19 19 <li>Queries</li> 20 <li><a href="${h.url_for('query', db_id=c.db_id, id=c.query_id)}">${h. label(c.query)}</a></li>20 <li><a href="${h.url_for('query', db_id=c.db_id, id=c.query_id)}">${h.hlabel(c.query)}</a></li> 21 21 <li class="here"><a href="${h.url_for('edit_query', db_id=c.db_id, id=c.query_id)}">Edit</a></li> 22 22 </ul> … … 31 31 <li> 32 32 <label for="f_${name}"> 33 ${h. label(field)}33 ${h.hlabel(field)} 34 34 </label> 35 35 <span class="value"> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/show.html
r2966 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.query)}4 ${h.hlabel(c.query)} 5 5 ← 6 6 Queries … … 10 10 <ul> 11 11 <li>Queries</li> 12 <li class="here"><a href="${h.url_for('query', id=c.query_id)}">${h. label(c.query)}</a></li>12 <li class="here"><a href="${h.url_for('query', id=c.query_id)}">${h.hlabel(c.query)}</a></li> 13 13 </ul> 14 14 </%def> … … 19 19 <li> 20 20 <label for="${name}"> 21 ${h. label(field)}21 ${h.hlabel(field)} 22 22 </label> 23 23 <span id="${name}" class="value"> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/transactions/edit.html
r2970 r2973 4 4 Edit 5 5 ← 6 ${h. label(c.tx)}6 ${h.hlabel(c.tx)} 7 7 ← 8 8 Transactions 9 9 ← 10 ${h. label(c.db)}10 ${h.hlabel(c.db)} 11 11 ← 12 12 Databases … … 16 16 <ul> 17 17 <li><a href="${h.url_for('databases')}">Databases</a></li> 18 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>18 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 19 19 <li>Transactions</li> 20 <li><a href="${h.url_for('transaction', db_id=c.db_id, id=c.tx_id)}">${h. label(c.tx)}</a></li>20 <li><a href="${h.url_for('transaction', db_id=c.db_id, id=c.tx_id)}">${h.hlabel(c.tx)}</a></li> 21 21 <li class="here"><a href="${h.url_for('edit_transaction', db_id=c.db_id, id=c.tx_id)}">Edit</a></li> 22 22 </ul> … … 31 31 <li> 32 32 <label for="f_${name}"> 33 ${h. label(field)}33 ${h.hlabel(field)} 34 34 </label> 35 35 <span class="value"> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/transactions/show.html
r2970 r2973 2 2 3 3 <%def name="title()"> 4 ${h. label(c.tx)}4 ${h.hlabel(c.tx)} 5 5 ← 6 6 Transactions 7 7 ← 8 ${h. label(c.db)}8 ${h.hlabel(c.db)} 9 9 ← 10 10 Databases … … 14 14 <ul> 15 15 <li><a href="${h.url_for('databases')}">Databases</a></li> 16 <li><a href="${h.url_for('database', id=c.db_id)}">${h. label(c.db)}</a></li>16 <li><a href="${h.url_for('database', id=c.db_id)}">${h.hlabel(c.db)}</a></li> 17 17 <li>Transactions</li> 18 <li class="here"><a href="${h.url_for('transaction', db_id=c.db_id, id=c.tx_id)}">${h. label(c.tx)}</a></li>18 <li class="here"><a href="${h.url_for('transaction', db_id=c.db_id, id=c.tx_id)}">${h.hlabel(c.tx)}</a></li> 19 19 </ul> 20 20 </%def> … … 25 25 <li> 26 26 <label for="${name}"> 27 ${h. label(field)}27 ${h.hlabel(field)} 28 28 </label> 29 29 <span id="${name}" class="value"> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extents.py
r2954 r2973 14 14 assert 'Foos' in response # plural label 15 15 assert '0' in response # length 16 assert 'Quer ies' in response16 assert 'Query Methods' in response 17 17 assert url_for( 18 18 'extent_q_methods', db_id='db', extent_id='Foo') in response 19 assert 'Transaction s' in response19 assert 'Transaction Methods' in response 20 20 assert url_for( 21 21 'extent_t_methods', db_id='db', extent_id='Foo') in response
