map.connect('/account/register', controller='account', action='register')
map.connect('/account/register_finish', controller='account', action='register_finish', **require_POST)
+ map.connect('/users', controller='users', action='list')
+ map.connect('/users/{name}', controller='users', action='view')
+
map.connect('/search', controller='search', action='index')
return map
--- /dev/null
+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+
+from floof.lib.base import BaseController, render
+from floof.model.users import User
+
+log = logging.getLogger(__name__)
+
+class UsersController(BaseController):
+
+ def list(self):
+ """List of all users."""
+
+ # TODO paging!
+ c.users = User.query.all()
+
+ return render('/users/index.mako')
--- /dev/null
+<%inherit file="/base.mako" />
+
+<ul>
+% for user in c.users:
+## TODO normalize URL names better perhaps
+ <li><a href="${url.current(action='view', name=user.name.lower())}">${user.name}</a></li>
+% endfor
+</ul>
--- /dev/null
+from floof.tests import *
+
+class TestUsersController(TestController):
+
+ def test_index(self):
+ response = self.app.get(url(controller='users', action='index'))
+ # Test response...