Commits

Ralph Bean committed 37b7416

Use the latest in technique.

Comments (0)

Files changed (1)

myapp/myapp/controllers/movie.py

     def movie(self, *args, **kw):
         w = MovieForm(redirect='/movie/').req()
         w.fetch_data(request)
-        mw = tw2.core.core.request_local()['middleware']
-        mw.controllers.register(w, 'movie_submit')
+        tw2.core.register_controller(w, 'movie_submit')
         return dict(widget=w, page='movie')
 
     @expose('myapp.templates.widget')
     def grid(self, *args, **kw):
-        mw = tw2.core.core.request_local()['middleware']
-        mw.controllers.register(GridWidget, 'db_jqgrid')
+        tw2.core.register_controller(GridWidget, 'db_jqgrid')
         return dict(widget=GridWidget, page='movie')
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.