Use the local model module instead of spline.model.
authorEevee <git@veekun.com>
Mon, 17 May 2010 02:27:01 +0000 (19:27 -0700)
committerEevee <git@veekun.com>
Mon, 17 May 2010 02:27:01 +0000 (19:27 -0700)
splinext/forum/__init__.py
splinext/forum/controllers/forum.py

index 55ffaa2..98ad4af 100644 (file)
@@ -4,11 +4,8 @@ from pylons import c, session
 
 from spline.lib.plugin import PluginBase
 from spline.lib.plugin import PluginBase, PluginLink, Priority
 
 from spline.lib.plugin import PluginBase
 from spline.lib.plugin import PluginBase, PluginLink, Priority
-import spline.model as model
-import spline.model.meta as meta
 
 import splinext.forum.controllers.forum
 
 import splinext.forum.controllers.forum
-import splinext.forum.model
 
 def add_routes_hook(map, *args, **kwargs):
     """Hook to inject some of our behavior into the routes configuration."""
 
 def add_routes_hook(map, *args, **kwargs):
     """Hook to inject some of our behavior into the routes configuration."""
@@ -23,18 +20,6 @@ class ForumPlugin(PluginBase):
             forum = splinext.forum.controllers.forum.ForumController,
         )
 
             forum = splinext.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)
-        ]
-
     def hooks(self):
         return [
             ('routes_mapping',    Priority.NORMAL,      add_routes_hook),
     def hooks(self):
         return [
             ('routes_mapping',    Priority.NORMAL,      add_routes_hook),
index bf66618..77e3fe4 100644 (file)
@@ -5,22 +5,23 @@ from pylons.controllers.util import abort, redirect_to
 from routes import request_config
 from sqlalchemy.orm.exc import NoResultFound
 
 from routes import request_config
 from sqlalchemy.orm.exc import NoResultFound
 
-from spline import model
 from spline.model import meta
 from spline.lib import helpers as h
 from spline.lib.base import BaseController, render
 from spline.model import meta
 from spline.lib import helpers as h
 from spline.lib.base import BaseController, render
+from splinext.forum import model as forum_model
 
 log = logging.getLogger(__name__)
 
 class ForumController(BaseController):
 
     def forums(self):
 
 log = logging.getLogger(__name__)
 
 class ForumController(BaseController):
 
     def forums(self):
-        c.forums = meta.Session.query(model.Forum).order_by(model.Forum.id.asc())
+        c.forums = meta.Session.query(forum_model.Forum) \
+            .order_by(forum_model.Forum.id.asc())
         return render('/forum/forums.mako')
 
     def threads(self, forum_id):
         try:
         return render('/forum/forums.mako')
 
     def threads(self, forum_id):
         try:
-            c.forum = meta.Session.query(model.Forum).get(forum_id)
+            c.forum = meta.Session.query(forum_model.Forum).get(forum_id)
         except NoResultFound:
             abort(404)
 
         except NoResultFound:
             abort(404)
 
@@ -28,7 +29,7 @@ class ForumController(BaseController):
 
     def posts(self, forum_id, thread_id):
         try:
 
     def posts(self, forum_id, thread_id):
         try:
-            c.thread = meta.Session.query(model.Thread) \
+            c.thread = meta.Session.query(forum_model.Thread) \
                 .filter_by(id=thread_id, forum_id=forum_id).one()
         except NoResultFound:
             abort(404)
                 .filter_by(id=thread_id, forum_id=forum_id).one()
         except NoResultFound:
             abort(404)