dd06f124d9762aba787e47a6109b5d28fda54f7a
[zzz-floof.git] / floof / controllers / art.py
1 import logging
2
3 from pylons import request, response, session, tmpl_context as c, config
4 from pylons.controllers.util import abort, redirect_to
5
6 from floof.lib.base import BaseController, render
7
8 log = logging.getLogger(__name__)
9
10
11
12 from floof.lib.file_storage import save_file
13
14 class ArtController(BaseController):
15
16 # def index():
17 # c.artwork = Art.query.order_by(Art.id.desc()).all()
18 # return render
19
20 def new(self):
21 """ New Art! """
22 return render("/art/new.mako")
23
24
25 def upload(self):
26 file = request.POST['file']
27 root = config['app_conf']['art_root']
28 save_file(root, file)
29 redirect_to(controller="main", action="index")