e78de41f928c118862ed0cae791ebc99400b6b0d
2 # floof/floof/model/art.py
4 # Copyright (c) 2009 Scribblr
7 from elixir
import Entity
, Field
, Integer
, Unicode
10 from pylons
import config
12 from floof
.lib
.file_storage
import get_path
, save_file
15 title
= Field(Unicode(120))
16 original_filename
= Field(Unicode(120))
19 def __init__(self
, **kwargs
):
20 # I wanted to check for the existence of the file, but...
21 # for some reason this FieldStorage object always conditions as falsey.
22 self
.hash = save_file("art", kwargs
.pop('file'))
25 super(Art
, self
).__init__(**kwargs
)
26 # this is what super is doing, pretty much.
27 # for key, value in kwargs.items():
28 # setattr(self, key, value)
34 return get_path("art", self
.hash)