Changeset 2929
- Timestamp:
- 02/21/07 12:47:09 (2 years ago)
- Files:
-
- sandbox/mscott/SchevoPylonsNav/trunk/development.ini (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/middleware.py (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/databases.py (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extents.py (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/app_globals.py (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/base.py (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/helpers.py (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/index.html (modified) (2 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/show.html (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/index.html (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/master.html (deleted)
- sandbox/mscott/SchevoPylonsNav/trunk/setup.py (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/test.ini (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/mscott/SchevoPylonsNav/trunk/development.ini
r2905 r2929 12 12 13 13 [pipeline:main] 14 pipeline = dbopener toscawidgetslogger schevopylonsnav14 pipeline = dbopener logger schevopylonsnav 15 15 16 16 [filter:dbopener] … … 18 18 schevo.db.db = %(here)s/dev.db 19 19 verbose = true 20 21 [filter:toscawidgets]22 use = egg:ToscaWidgets#middleware23 host_framework = pylons24 prefix = /_tw25 20 26 21 [filter:logger] sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/middleware.py
r2905 r2929 30 30 # Load our Pylons configuration defaults 31 31 config = load_environment(global_conf, app_conf) 32 config.init_app(global_conf, app_conf, package='schevopylonsnav') 32 config.init_app(global_conf, app_conf, package='schevopylonsnav', 33 template_engine='mako') 33 34 34 # Set up Genshi-only template engine35 config.template_engines = []36 genshi_options = dict(37 (k, v) for k, v in app_conf.iteritems() if k.startswith('genshi')38 )39 config.add_template_engine('genshi', 'schevopylonsnav.templates', genshi_options)40 41 35 # Load our default Pylons WSGI app and make g available 42 36 app = pylons.wsgiapp.PylonsApp(config, helpers=schevopylonsnav.lib.helpers, sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/databases.py
r2920 r2929 13 13 """GET /: All items in the collection.""" 14 14 # url_for('databases') 15 dbs = self.dbs 16 c.dbs_url = h.url_for('databases') 17 c.databases = databases = [] 18 for db_name, db in dbs.iteritems(): 19 db_label = label(db) 20 db_url = h.url_for('database', id=db_name) 21 databases.append((db_label, db_url)) 22 return render_response('databases.index') 15 c.dbs = self.dbs 16 return render_response('/databases/index.html') 23 17 24 18 def create(self): … … 53 47 """GET /id: Show a specific item.""" 54 48 # url_for('database', id=ID) 55 db = self.dbs[id] 56 c.db_label = label(db) 57 c.db_url = h.url_for('database', id=id) 58 c.dbs_url = h.url_for('databases') 59 c.extents_url = h.url_for('extents', db_id=id) 60 return render_response('databases.show') 49 c.db = self.dbs[id] 50 c.db_id = id 51 return render_response('/databases/show.html') 61 52 62 53 def edit(self, id, format='html'): sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extents.py
r2927 r2929 13 13 """GET /: All items in the collection.""" 14 14 # url_for('extents') 15 db = self.dbs[db_id] 16 c.databases_url = h.url_for('databases') 17 c.db_label = label(db) 18 c.db_url = h.url_for('database', id=db_id) 19 c.extents_url = h.url_for('extents', db_id=db_id) 20 c.extents = extents = [] 21 for extent in db.extents(): 22 extent_plural = plural(extent) 23 extent_url = h.url_for('extent', db_id=db_id, id=extent.name) 24 extents.append((extent_plural, extent_url)) 25 return render_response('extents.index') 15 c.db = self.dbs[db_id] 16 c.db_id = db_id 17 return render_response('/extents/index.html') 26 18 27 19 def create(self): … … 56 48 """GET /id: Show a specific item.""" 57 49 # url_for('extent', id=ID) 58 db = self.dbs[db_id] 59 c.databases_url = h.url_for('databases') 60 c.db_label = label(db) 61 c.db_url = h.url_for('database', id=db_id) 62 c.extents_url = h.url_for('extents', db_id=db_id) 63 extent = db.extent(id) 64 c.extent_label = label(extent) 65 c.extent_plural = plural(extent) 66 c.extent_len = len(extent) 67 c.extent_name = extent.name 68 c.extent_url = h.url_for('extent', db_id=db_id, id=id) 69 c.queries_url = h.url_for('extent_queries', db_id=db_id, extent_id=id) 70 c.transactions_url = h.url_for( 71 'extent_transactions', db_id=db_id, extent_id=id) 72 return render_response('extents.show') 50 c.db = db = self.dbs[db_id] 51 c.db_id = db_id 52 c.extent = db.extent(id) 53 return render_response('/extents/show.html') 73 54 74 55 def edit(self, id, format='html'): sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/app_globals.py
r2905 r2929 1 from toscawidgets.api import WidgetBunch2 3 4 1 class Globals(object): 5 2 … … 29 26 30 27 """ 31 self.w = WidgetBunch()28 pass 32 29 33 30 def __del__(self): sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/base.py
r2915 r2929 5 5 from pylons.helpers import abort, redirect_to, etag_cache 6 6 from pylons.i18n import N_, _, ungettext 7 8 from toscawidgets.api import retrieve_resources, WidgetBunch9 7 10 8 import schevopylonsnav.models as model … … 17 15 # the action or route vars here 18 16 # 19 # Create c.w namespace.20 c.w = WidgetBunch()21 17 # Get Schevo database. 22 18 self.dbs = environ['schevo.db'] sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/lib/helpers.py
r2905 r2929 8 8 from pylons.i18n import get_lang, set_lang 9 9 10 from toscawidgets.widgets.forms import HiddenField10 from schevo.label import label, plural 11 11 12 12 13 # Widgets for placement inside REST-style PUT and DELETE forms. 14 DELETE = HiddenField('_method', default='DELETE') 15 PUT = HiddenField('_method', default='PUT') 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') sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/index.html
r2928 r2929 1 1 <!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> 6 3 <head> 7 4 <title>Databases</title> … … 9 6 <body> 10 7 <div id="breadcrumbs"> 11 <a href="${ c.dbs_url}">Databases</a>8 <a href="${h.url_for('databases')}">Databases</a> 12 9 </div> 13 10 14 11 <ul> 15 <li py:for="db_label, db_url in c.databases"> 16 <a href="${db_url}">${db_label}</a> 17 </li> 12 % for db_id, db in c.dbs.iteritems(): 13 <li> 14 <a href="${h.url_for('database', id=db_id)}">${h.label(db)}</a> 15 </li> 16 % endfor 18 17 </ul> 19 18 </body> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/databases/show.html
r2928 r2929 1 1 <!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> 6 3 <head> 7 <title>${ c.db_label} ← Databases</title>4 <title>${h.label(c.db)} ← Databases</title> 8 5 </head> 9 6 <body> 10 7 <div id="breadcrumbs"> 11 <a href="${ c.dbs_url}">Databases</a>8 <a href="${h.url_for('databases')}">Databases</a> 12 9 → 13 <a href="${ c.db_url}">${c.db_label}</a>10 <a href="${h.url_for('database', id=c.db_id)}">${h.label(c.db)}</a> 14 11 </div> 15 12 16 13 <ul> 17 14 <li> 18 <a href="${ c.extents_url}">Extents</a>15 <a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a> 19 16 </li> 20 17 </ul> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/index.html
r2928 r2929 1 1 <!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> 6 3 <head> 7 <title>Extents ← ${ c.db_label} ← Databases</title>4 <title>Extents ← ${h.label(c.db)} ← Databases</title> 8 5 </head> 9 6 <body> 10 7 <div id="breadcrumbs"> 11 <a href="${ c.databases_url}">Databases</a>8 <a href="${h.url_for('databases')}">Databases</a> 12 9 → 13 <a href="${ c.db_url}">${c.db_label}</a>10 <a href="${h.url_for('database', id=c.db_id)}">${h.label(c.db)}</a> 14 11 → 15 <a href="${ c.extents_url}">Extents</a>12 <a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a> 16 13 </div> 17 14 18 15 <ul> 19 <li py:for="extent_plural, extent_url in c.extents"> 20 <a href="${extent_url}">${extent_plural}</a> 21 </li> 16 % for extent in c.db.extents(): 17 <li> 18 <a href="${h.url_for('extent', db_id=c.db_id, id=extent.name)}" 19 >${h.plural(extent)}</a> 20 </li> 21 % endfor 22 22 </ul> 23 23 </body> sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html
r2928 r2929 1 1 <!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> 6 3 <head> 7 <title>${c.extent_plural} in ${c.db_label} -- Navigator</title> 4 <title> 5 ${h.plural(c.extent)} 6 ← 7 Extents 8 ← 9 ${h.label(c.db)} 10 ← 11 Databases 12 </title> 8 13 </head> 9 14 <body> 10 15 <div id="breadcrumbs"> 11 <a href="${ c.databases_url}">Databases</a>16 <a href="${h.url_for('databases')}">Databases</a> 12 17 → 13 <a href="${ c.db_url}">${c.db_label}</a>18 <a href="${h.url_for('database', id=c.db_id)}">${h.label(c.db)}</a> 14 19 → 15 <a href="${ c.extents_url}">Extents</a>20 <a href="${h.url_for('extents', db_id=c.db_id)}">Extents</a> 16 21 → 17 <a href="${c.extent_url}">${c.extent_plural}</a> 22 <a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 23 >${h.plural(c.extent)}</a> 18 24 </div> 19 25 20 26 <dl> 21 27 <dt>Name</dt> 22 <dd>${c.extent _name}</dd>28 <dd>${c.extent.name}</dd> 23 29 24 30 <dt>Label</dt> 25 <dd>${ c.extent_label}</dd>31 <dd>${h.label(c.extent)}</dd> 26 32 27 33 <dt>Plural label</dt> 28 <dd>${ c.extent_plural}</dd>34 <dd>${h.plural(c.extent)}</dd> 29 35 30 36 <dt>Length</dt> 31 <dd>${ c.extent_len}</dd>37 <dd>${len(c.extent)}</dd> 32 38 </dl> 33 39 34 40 <ul> 35 41 <li> 36 <a href="${c.queries_url}">Queries</a> 42 <a href="${h.url_for('extent_queries', db_id=c.db_id, extent_id=c.extent.name)}" 43 >Queries</a> 37 44 </li> 38 45 39 46 <li> 40 <a href="${c.transactions_url}">Transactions</a> 47 <a href="${h.url_for('extent_transactions', db_id=c.db_id, extent_id=c.extent.name)}" 48 >Transactions</a> 41 49 </li> 42 50 </ul> sandbox/mscott/SchevoPylonsNav/trunk/setup.py
r2911 r2929 23 23 24 24 install_requires = [ 25 'Genshi==dev,>=0.4dev-r493',25 # 'Genshi==dev,>=0.4dev-r493', 26 26 'Pylons==dev,>=0.9.5dev-r1770', 27 27 'Schevo==dev,>=3.0b4dev-r2831', 28 28 'SchevoWsgi==dev,>=0.1a1dev-r2820', 29 'ToscaWidgets==dev,>=0.1a2dev-r2454', 30 'twForms==dev,>=0.1a2dev-r2418', 29 # 'ToscaWidgets==dev,>=0.1a2dev-r2454', 30 # 'twForms==dev,>=0.1a2dev-r2418', 31 'Mako', 31 32 ], 32 33 sandbox/mscott/SchevoPylonsNav/trunk/test.ini
r2913 r2929 16 16 17 17 [pipeline:main] 18 pipeline = dbopener toscawidgetsschevopylonsnav18 pipeline = dbopener schevopylonsnav 19 19 20 20 [filter:dbopener] … … 22 22 schevo.db.db = memory://schevopylonsnav.schema/1 23 23 verbose = true 24 25 [filter:toscawidgets]26 use = egg:ToscaWidgets#middleware27 host_framework = pylons28 prefix = /_tw29 24 30 25 [app:schevopylonsnav]
