8989e8fcffcf82f522539ff64185589ce45f23d6
2 # floof/floof/model/art.py
4 # Copyright (c) 2009 Scribblr
7 # from elixir import Entity, Field, Integer, Unicode
11 from pylons
import config
13 from floof
.lib
.file_storage
import get_path
, save_file
14 from floof
.lib
.dbhelpers
import find_or_create
, update_or_create
15 import floof
.model
.comments
18 # Note: Art is the most important class. To keep its size down, and to better organize the source code,
19 # other modules will mix into it automatically by adding to its __bases__.
22 title
= Field(Unicode(120))
23 original_filename
= Field(Unicode(120))
24 hash = Field(Unicode(40), unique
=True, required
=True)
25 mimetype
= Field(Unicode(32), required
=True)
27 uploader
= ManyToOne('User', required
=True)
28 tags
= OneToMany('Tag')
29 discussion
= ManyToOne('Discussion')
31 user_relations
= OneToMany('UserRelation')
35 return get_path("art", self
.hash)