use ids now

This commit is contained in:
James Turk 2012-05-01 16:33:51 -04:00
parent 97e164e6e6
commit 75dadb2579
2 changed files with 3 additions and 14 deletions

View File

@ -1,6 +1,6 @@
<tr{% if log.error %} class="error" {% endif %}>
<td>{{log.action}}</td>
<td><a href="{{request.script_root}}/tracked/{{log.url}}">{{log.url}}</td>
<td><a href="{{request.script_root}}/tracked/{{log._id}}">{{log.url}}</td>
<td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td>
<td>{% if log.error %}{{log.error}}{% endif %}</td>
</tr>

View File

@ -86,23 +86,12 @@ def tracked():
return json.dumps(tracked, cls=JSONEncoder)
@app.route('/tracked/<path:url>')
@app.route('/tracked/<path:id>')
def tracked_view(url):
url = _path_fixer(url)
doc = kernel.db.tracked.find_one({'url': url})
doc = kernel.db.tracked.find_one({'_id': id})
return json.dumps(doc, cls=JSONEncoder)
@app.route('/doc/<path:url>/<version>')
def show_doc(url, version):
url = _path_fixer(url)
if version == 'latest':
version = -1
doc = kernel.get_version(url, version)
resp = flask.make_response(doc.read())
resp.headers['content-type'] = doc.content_type
return resp
if __name__ == '__main__':
app.run(debug=True)