7378f7acc71f972db18ebe204758fb692c1e237c
3 from pylons
import request
, response
, session
, tmpl_context
as c
4 from pylons
.controllers
.util
import abort
, redirect_to
6 from floof
.lib
.base
import BaseController
, render
8 log
= logging
.getLogger(__name__
)
11 from floof
.model
.art
import Art
13 class ArtController(BaseController
):
16 # c.artwork = Art.query.order_by(Art.id.desc()).all()
21 return render("/art/new.mako")
25 print "PARAMS", request
.params
26 Art(uploaded_by
=c
.user
, **request
.params
)
27 elixir
.session
.commit()
28 redirect_to(controller
="main", action
="index")
32 c
.your_score
= c
.art
.user_score(c
.user
)
33 return render("/art/show.mako")
35 # should force logged in on these things
38 art
.add_tags(request
.params
["tags"], c
.user
)
39 elixir
.session
.commit()
40 redirect_to(action
="show", id=art
.id)
44 art
.rate(request
.params
["score"], c
.user
)
45 elixir
.session
.commit()
46 redirect_to(action
="show", id=art
.id)