-from pylons import request, response, session, tmpl_context as c
+from pylons import request, response, session, tmpl_context as c, h
from pylons.controllers.util import abort, redirect_to
from floof.lib.base import BaseController, render
from pylons.controllers.util import abort, redirect_to
from floof.lib.base import BaseController, render
def upload(self):
print "PARAMS", request.params
Art(uploaded_by=c.user, **request.params)
def upload(self):
print "PARAMS", request.params
Art(uploaded_by=c.user, **request.params)
- art = Art.get(id)
- art.add_tags(request.params["tags"], c.user)
+ c.art = h.get_object_or_404(Art, id=id)
+ c.art.add_tags(request.params["tags"], c.user)
- art = Art.get(id)
- art.rate(request.params["score"], c.user)
+ c.art = h.get_object_or_404(Art, id=id)
+ c.art.rate(request.params["score"], c.user)