Changeset 2966
- Timestamp:
- 02/24/07 12:30:12 (2 years ago)
- Files:
-
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_q_methods.py (modified) (1 diff)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/queries.py (modified) (3 diffs)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/edit.html (added)
- sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/show.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_q_methods.py
r2954 r2966 27 27 token = g.new_cache_token(query_cache) 28 28 query_cache[token] = query 29 return redirect_to(h.url_for('query', id=token))29 return redirect_to(h.url_for('query', db_id=db_id, id=token)) 30 30 31 31 def create(self): sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/queries.py
r2938 r2966 23 23 pass 24 24 25 def update(self, id):25 def update(self, db_id, id): 26 26 """PUT /id: Update an existing item.""" 27 27 # Forms posted to this method should contain a hidden field: … … 30 30 # h.form(h.url_for('query', id=ID), method='put') 31 31 # url_for('query', id=ID) 32 pass 32 # 33 # XXX: Only works for param queries. 34 postvars = request.POST 35 query = g.query_cache[id] 36 for field_name, field in query.sys.field_map().iteritems(): 37 if field_name in postvars: 38 value = postvars[field_name] 39 setattr(query, field_name, value) 40 return redirect_to(h.url_for('query', db_id=db_id, id=id)) 33 41 34 42 def delete(self, id): … … 41 49 pass 42 50 43 def show(self, id, format='html'):51 def show(self, db_id, id, format='html'): 44 52 """GET /id: Show a specific item.""" 45 53 # url_for('query', id=ID) 54 c.db_id = db_id 46 55 c.query = g.query_cache[id] 47 56 c.query_id = id 48 57 return render_response('/queries/show.html') 49 58 50 def edit(self, id, format='html'):59 def edit(self, db_id, id, format='html'): 51 60 """GET /id;edit: Form to edit an existing item.""" 52 61 # url_for('edit_query', id=ID) 53 pass 54 62 c.db_id = db_id 63 c.query = g.query_cache[id] 64 c.query_id = id 65 return render_response('/queries/edit.html') sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/queries/show.html
r2944 r2966 29 29 </%def> 30 30 31 <%def name="actions()"> 32 <form method="get" action="${h.url_for('edit_query', db_id=c.db_id, id=c.query_id)}"> 33 <input type="submit" value="Edit" /> 34 </form> 35 </%def>
