class Art(Entity):
title = Field(Unicode(120))
original_filename = Field(Unicode(120))
- hash = Field(String)
+ hash = Field(String, unique=True, required=True)
- uploader = ManyToOne('User')
+ uploader = ManyToOne('User', required=True)
tags = OneToMany('Tag')
# def __init__(self, **kwargs):
def set_file(self, file):
self.hash = save_file("art", file)
+ self.original_filename = file.filename
file = property(get_path, set_file)
# options = ["sucks","neutral","good","great"]
-Rating.reverse_options = dict (zip(Rating.options.values(), Rating.options.keys()))
\ No newline at end of file
+Rating.reverse_options = dict (zip(Rating.options.values(), Rating.options.keys()))
+
+
+
+
+class UserRelation(Entity):
+ related = ManyToOne("User")
+ art = ManyToOne("Art")
+ type = Field(String) # by for of
+
+
+# class CharacterRelation(Entity):
+# pass
\ No newline at end of file