From: Eevee Date: Sat, 8 May 2010 23:28:17 +0000 (-0700) Subject: Dead simple user list. X-Git-Tag: veekun-promotions/2010050901^0 X-Git-Url: http://git.veekun.com/zzz-spline-users.git/commitdiff_plain/a35a43eeaf6e7fe1247657ffffda8bb1735def12?ds=inline Dead simple user list. --- diff --git a/spline/plugins/users/__init__.py b/spline/plugins/users/__init__.py index f0c8a33..e606823 100644 --- a/spline/plugins/users/__init__.py +++ b/spline/plugins/users/__init__.py @@ -22,7 +22,8 @@ def add_routes_hook(map, *args, **kwargs): # Self-admin map.connect('/users/{id};{name}/edit', controller='users', action='profile_edit') - # Public per-user pages + # Public user pages + map.connect('/users', controller='users', action='list') map.connect('/users/{id};{name}', controller='users', action='profile') map.connect('/users/{id}', controller='users', action='profile') diff --git a/spline/plugins/users/controllers/users.py b/spline/plugins/users/controllers/users.py index 4811aa0..4afb9cd 100644 --- a/spline/plugins/users/controllers/users.py +++ b/spline/plugins/users/controllers/users.py @@ -41,11 +41,9 @@ class ProfileEditForm(Form): class UsersController(BaseController): - def index(self): - # Return a rendered template - # return render('/template.mako') - # or, Return a response - return 'stub' + def list(self): + c.users = meta.Session.query(model.User).order_by(model.User.id.asc()) + return render('/users/list.mako') def profile(self, id, name=None): """Main user profile. diff --git a/spline/plugins/users/templates/users/list.mako b/spline/plugins/users/templates/users/list.mako new file mode 100644 index 0000000..fc25241 --- /dev/null +++ b/spline/plugins/users/templates/users/list.mako @@ -0,0 +1,16 @@ +<%inherit file="/base.mako" /> +<%namespace name="userlib" file="/users/lib.mako" /> + +<%def name="title()">Users + +

Users

+ +