import os.path
import PIL
import PIL.Image
-from sqlalchemy import func
from sqlalchemy.exceptions import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from wtforms.validators import ValidationError
def watchstream(self, name):
"""Watchstream for a certain user."""
try:
- c.watching_user = User.query.filter(func.lower(User.name) == name) \
- .one()
+ c.watching_user = User.get_by(name=name)
except NoResultFound:
abort(404)
from floof.lib.base import BaseController, render
from floof.lib.dbhelpers import find_or_create
from floof.lib import helpers as h
-from sqlalchemy import func
log = logging.getLogger(__name__)
# Do work!
if prefix:
- target_user = User.query.filter(func.lower(User.name) == tag_text) \
- .one()
+ target_user = User.get_by(name=tag_text)
# Special tag; at the moment, just a relationship
if prefix == 'by':
import elixir
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
import floof.lib.helpers as h
`type`, and `add_remove` as parameters.
"""
try:
- user = User.query.filter(func.lower(User.name) == name).one()
+ user = User.get_by(name=name)
except NoResultFound:
abort(404)
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
"""Userpage."""
try:
- c.this_user = User.query.filter(func.lower(User.name) == name) \
- .one()
+ c.this_user = User.get_by(name=name)
except NoResultFound:
abort(404)