def add_routes_hook(map, *args, **kwargs):
"""Hook to inject some of our behavior into the routes configuration."""
- map.connect('/forum', controller='forum', action='index')
+ map.connect('/forums', controller='forum', action='forums')
+ map.connect('/forums/{forum_id}', controller='forum', action='threads')
+ map.connect('/forums/{forum_id}/threads/{thread_id}', controller='forum', action='posts')
class ForumPlugin(PluginBase):
forum = spline.plugins.forum.controllers.forum.ForumController,
)
+ def model(self):
+ return [
+ model.Forum,
+ model.Thread,
+ model.Post,
+ ]
+
def template_dirs(self):
return [
(resource_filename(__name__, 'templates'), Priority.NORMAL)