011468ce4d367795e7647ca7f615acc8e2270f84
4 class SavedSearch(Entity
):
5 string
= Field(Unicode
) # I tried calling this query, but it broke elixir
6 author
= ManyToOne(User
)
12 class GalleryWidget(Entity
):
13 search
= ManyToOne(SavedSearch
)
14 displayer
= ManyToOne(User
) # determines whose page should it should show up on
15 # Could be no-ones, if it's just a template.
17 # Needs some fields for position on your page
21 return self
.search
.query
24 def query(self
, value
):
25 # TODO: should we delete the possibly orphaned saved search?
26 if not self
.displayer
:
27 # TODO: may have to refactor this into an init if the key ordering is inconvenienc
28 raise "Oh no! This gallery needs a displayer to set on the saved search."
30 self
.search
= SavedSearch(author
=self
.displayer
, query
=value
)