e812afca3af46b4495fb71e2bae7783575a295ae
2 # from users import User
4 from floof
.lib
.search
import do_search
6 class SavedSearch(Entity
):
7 string
= Field(Unicode
) # I tried calling this query, but it broke elixir
8 author
= ManyToOne('User')
10 def __unicode__(self
):
15 return do_search(self
.string
)
19 class GalleryWidget(Entity
):
20 search
= ManyToOne(SavedSearch
)
21 displayer
= ManyToOne('User') # determines whose page should it should show up on
22 # Could be no-ones, if it's just a template.
24 # Needs some fields for position on your page
31 def string(self
, value
):
32 # TODO: should we delete the possibly orphaned saved search?
33 if not self
.displayer
:
34 # TODO: may have to refactor this into an init if the key ordering is inconvenienc
35 raise "Oh no! This gallery needs a displayer to set on the saved search."
37 self
.search
= SavedSearch(author
=self
.displayer
, string
=value
)
40 # class UserPage(Entity):
41 # owner = ManyToOne('User')
42 # visible = Field(Boolean)