merged in my branch 'resources', which is not aptly named anymore since it no longer...
[zzz-floof.git] / floof / model / search.py
index e812afc..be2bb9e 100644 (file)
@@ -17,9 +17,12 @@ class SavedSearch(Entity):
 
 
 class GalleryWidget(Entity):
+    page = ManyToOne('UserPage')
     search = ManyToOne(SavedSearch)
-    displayer = ManyToOne('User') # determines whose page should it should show up on
-                                # Could be no-ones, if it's just a template.
+
+    # 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
 
@@ -30,13 +33,9 @@ class GalleryWidget(Entity):
     @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=self.displayer, string=value)
-        
+        # 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."
         
-# class UserPage(Entity):
-#     owner = ManyToOne('User')
-#     visible = Field(Boolean)
\ No newline at end of file
+        self.search = SavedSearch(author=getattr(self,"author",None), string=value)
+        
\ No newline at end of file