X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/69d5189cc4fb2ca63418a0741bf744cf5fee8bc9..36dba08534b4309de0e0746784e2a6c5bb854030:/floof/model/search.py diff --git a/floof/model/search.py b/floof/model/search.py index be2bb9e..f03de51 100644 --- a/floof/model/search.py +++ b/floof/model/search.py @@ -1,18 +1,14 @@ from elixir import * # from users import User -from floof.lib.search import do_search class SavedSearch(Entity): string = Field(Unicode) # I tried calling this query, but it broke elixir author = ManyToOne('User') - + fork = ManyToOne("SavedSearch") + def __unicode__(self): return self.string - - @property - def results(self): - return do_search(self.string) @@ -23,19 +19,18 @@ class GalleryWidget(Entity): # NOTE: no longer needed now that we have pages, I guess. # displayer = ManyToOne('User') # determines whose page should it should show up on # # Could be no-ones, if it's just a template. - + # Needs some fields for position on your page @property def string(self): - return self.search - + return self.search.string + @string.setter def string(self, value): # TODO: should we delete the possibly orphaned saved search? # if not self.displayer: # # TODO: may have to refactor this into an init if the key ordering is inconvenienc # raise "Oh no! This gallery needs a displayer to set on the saved search." - + self.search = SavedSearch(author=getattr(self,"author",None), string=value) - \ No newline at end of file