Andy Mikhailenko avatar Andy Mikhailenko committed 1601557

Upgraded extension "talks" to the new Tool API. (Bulk commit of stale code between 2010-11-08 and 2010-12-01.)

Comments (0)

Files changed (3)

orgtool/ext/talks/__init__.py

 # -*- coding: utf-8 -*-
+"""
+Talks
+=====
 
+Communication tracker.
+"""
+from tool.plugins import BasePlugin
 from tool.ext.templating import register_templates
 from schema import *
 from views import *
 import admin
 
 
-register_templates(__name__)
-
+class TalksPlugin(BasePlugin):
+    """Web interface.
+    """
+    def make_env(self):
+        register_templates(__name__)
 
 # just an idea:
 #from tool.app import App

orgtool/ext/talks/schema.py

 # -*- coding: utf-8 -*-
 
 import datetime
-from docu import Document, Field as f
+from doqu import Document, Field as f
 from tool.ext import admin
 from orgtool.ext.events import Event
 

orgtool/ext/talks/views.py

 
 from tool.routing import url
 from tool.ext.breadcrumbs import entitled
-from tool.ext.documents import db
+from tool.ext.documents import default_storage
 from tool.ext.templating import as_html
 
 from schema import Message
                                kw.get('year') or u'Messages'))
 @as_html('talks/message_index.html')
 def message_index(request, year=None, month=None, day=None):
+    db = default_storage()
     messages = Message.objects(db).order_by('date_time', reverse=True)
     if year:
         messages = messages.where(date_time__year=year)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.