posted by me checkbox
[zzz-floof.git] / floof / controllers / users.py
index 1e251f0..1a79c15 100644 (file)
@@ -6,7 +6,7 @@ from sqlalchemy import func
 from sqlalchemy.orm.exc import NoResultFound
 
 from floof.lib.base import BaseController, render
 from sqlalchemy.orm.exc import NoResultFound
 
 from floof.lib.base import BaseController, render
-from floof.model.users import User
+from floof.model.users import User, UserRelationship
 
 log = logging.getLogger(__name__)
 
 
 log = logging.getLogger(__name__)
 
@@ -29,4 +29,11 @@ class UsersController(BaseController):
         except NoResultFound:
             abort(404)
 
         except NoResultFound:
             abort(404)
 
+        rels = UserRelationship.query.filter_by(
+            user_id=c.user.id,
+            target_user_id=c.this_user.id,
+        ).all()
+
+        c.relationships = [_.type for _ in rels]
+
         return render('/users/view.mako')
         return render('/users/view.mako')