From b937806fb5039b4073784b576ffeb30c7fab499c Mon Sep 17 00:00:00 2001 From: Eevee Date: Sun, 4 Oct 2009 21:24:25 -0700 Subject: [PATCH 1/1] Stubbed out userpages. --- floof/controllers/users.py | 13 +++++++++++++ floof/templates/users/view.mako | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 floof/templates/users/view.mako diff --git a/floof/controllers/users.py b/floof/controllers/users.py index 1758653..1e251f0 100644 --- a/floof/controllers/users.py +++ b/floof/controllers/users.py @@ -2,6 +2,8 @@ import logging from pylons import request, response, session, tmpl_context as c from pylons.controllers.util import abort, redirect_to +from sqlalchemy import func +from sqlalchemy.orm.exc import NoResultFound from floof.lib.base import BaseController, render from floof.model.users import User @@ -17,3 +19,14 @@ class UsersController(BaseController): c.users = User.query.all() return render('/users/index.mako') + + def view(self, name): + """Userpage.""" + + try: + c.this_user = User.query.filter(func.lower(User.name) == name) \ + .one() + except NoResultFound: + abort(404) + + return render('/users/view.mako') diff --git a/floof/templates/users/view.mako b/floof/templates/users/view.mako new file mode 100644 index 0000000..9f39bae --- /dev/null +++ b/floof/templates/users/view.mako @@ -0,0 +1,3 @@ +<%inherit file="/base.mako" /> + +

This is the userpage for ${c.this_user.name}.

-- 2.7.4