3 from pylons
import request
, response
, session
, tmpl_context
as c
, h
4 from pylons
.controllers
.util
import abort
, redirect
6 from floof
.lib
.base
import BaseController
, render
9 log
= logging
.getLogger(__name__
)
12 from floof
.model
.art
import Art
, Tag
14 class TagController(BaseController
):
16 # TODO: login required
17 def delete(self
, art_id
, id):
18 tag
= h
.get_object_or_404(Tag
, id=id)
19 elixir
.session
.delete(tag
)
20 elixir
.session
.commit()
21 redirect(url('show_art', id=art_id
))
23 # TODO: login required
24 def create(self
, art_id
):
25 c
.art
= h
.get_object_or_404(Art
, id=art_id
)
26 c
.art
.add_tags(request
.params
.get("tags",""), c
.user
)
27 elixir
.session
.commit()
28 redirect(url('show_art', id=c
.art
.id))