Add an home_for reference property
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 21 Feb 2009 00:33:59 +0000
changeset 1416 6c94a1531ead
parent 1415 d34768bf62d8
child 1417 8b9e256a3abe
Add an home_for reference property This field will be set to whatever presence is using the document as home document. Patch by: Sverre Rabbelier
app/soc/models/document.py
app/soc/views/models/document.py
--- a/app/soc/models/document.py	Sat Feb 21 00:30:53 2009 +0000
+++ b/app/soc/models/document.py	Sat Feb 21 00:33:59 2009 +0000
@@ -26,6 +26,7 @@
 
 from django.utils.translation import ugettext
 
+import soc.models.linkable
 import soc.models.work
 
 
@@ -79,3 +80,10 @@
   is_featured.help_text = ugettext(
       'Field used to indicate if a Work should be featured, for example,'
       ' in the sidebar menu.')
+
+  #: Reference to Document containing the contents of the "/home" page
+  home_for = db.ReferenceProperty(
+    reference_class=soc.models.linkable.Linkable,
+    collection_name='home_docs')
+  home_for.help_text = ugettext(
+      'The Precense this document is the home document for.')
--- a/app/soc/views/models/document.py	Sat Feb 21 00:30:53 2009 +0000
+++ b/app/soc/views/models/document.py	Sat Feb 21 00:33:59 2009 +0000
@@ -96,7 +96,7 @@
         'clean_scope_path': cleaning.clean_scope_path('scope_path'),
         'clean': cleaning.validate_document_acl(self),
         }
-    new_params['extra_dynaexclude'] = ['author', 'created',
+    new_params['extra_dynaexclude'] = ['author', 'created', 'home_for',
                                        'modified_by', 'modified']
 
     new_params['edit_extra_dynafields'] = {