Cleanup in org_app and replace ReferenceProperty with LinkProperty
authorSverre Rabbelier <srabbelier@gmail.com>
Thu, 05 Feb 2009 23:52:27 +0000
changeset 1230 b1b1897e4df1
parent 1229 ec3768cbf369
child 1231 ab19a8ad375f
Cleanup in org_app and replace ReferenceProperty with LinkProperty Using LinkProperty allows the org to host their idea's list on Melange through the Document system, and then specify the URL of that document. This also makes it possible for the orgs to specify a document that is not hosted on Melange. Patch by: Sverre Rabbelier
app/soc/models/org_app.py
app/soc/views/models/org_app.py
--- a/app/soc/models/org_app.py	Thu Feb 05 23:49:46 2009 +0000
+++ b/app/soc/models/org_app.py	Thu Feb 05 23:52:27 2009 +0000
@@ -40,64 +40,50 @@
   (converted) to their new representations in the Datastore.
   """
   
-  prior_participation = db.TextProperty(required=False,
-    verbose_name=ugettext(
+  prior_participation = db.TextProperty(required=False, verbose_name=ugettext(
       'Has your group participated previously?'
       ' If so, please summarize your involvement and any past successes'
       ' and failures.'))
 
-  prior_application = db.TextProperty(required=False,
-    verbose_name=ugettext(
+  prior_application = db.TextProperty(required=False, verbose_name=ugettext(
       'If your group has not previously participated, have you applied in'
       ' the past?  If so, for what sort of participation?'))
   
-  license_name = db.StringProperty(required=True,
-    verbose_name=ugettext(
+  license_name = db.StringProperty(required=True, verbose_name=ugettext(
       'What license does your organization use?'))
  
-  ideas = db.ReferenceProperty(reference_class=soc.models.document.Document,
-    required=True, collection_name='ideas_app',
-    verbose_name=ugettext(
-      'Please select the Document containing your ideas list.'))
+  ideas = db.LinkProperty(required=True, verbose_name=ugettext(
+      'What is the ideas list of your organization?'))
 
-  dev_mailing_list = db.StringProperty(required=False,
-    verbose_name=ugettext(
-      'What is the main development mailing list for your group?'
-      ' (optional)'))
+  dev_mailing_list = db.StringProperty(required=False, verbose_name=ugettext(
+      'What is the main development mailing list for your group?'))
   dev_mailing_list.help_text = ugettext(
-    'Mailing list email address, URL to sign-up page, etc.')
+      'Mailing list email address, URL to sign-up page, etc.')
 
-  contrib_template = db.ReferenceProperty(
-    reference_class=soc.models.document.Document, required=False,
-    collection_name='org_app_contrib_template',
-    verbose_name=ugettext(
-      'Please select the application template you would like contributors'
-      ' to your group to use.  (optional).'))
+  contrib_template = db.LinkProperty(required=False, verbose_name=ugettext(
+      'What application template would you like contributors'
+      ' to your organization to use.'))
   contrib_template.help_text = ugettext(
-    'This template will be presented to contributors, such as students'
-    ' and other non-member participants, when they apply to contribute'
-    ' to the organization.')
+      'This template can be used by contributors, such as students'
+      ' and other non-member participants, when they apply to contribute'
+      ' to the organization.')
 
-  contrib_disappears = db.TextProperty(required=True,
-    verbose_name=ugettext(
+  contrib_disappears = db.TextProperty(required=True, verbose_name=ugettext(
       'What is your plan for dealing with disappearing contributors?'))
   contrib_disappears.help_text = ugettext(
-    'Contributors include students and other non-member participants.')
+      'Contributors include students and other non-member participants.')
 
-  member_disappears = db.TextProperty(required=True,
-    verbose_name=ugettext(
+  member_disappears = db.TextProperty(required=True, verbose_name=ugettext(
       'What is your plan for dealing with disappearing members?'))
   member_disappears.help_text = ugettext(
-    'Members include mentors, administrators, and the like.')
+      'Members include mentors, administrators, and the like.')
 
-  encourage_contribs = db.TextProperty(required=True,
-    verbose_name=ugettext(
+  encourage_contribs = db.TextProperty(required=True, verbose_name=ugettext(
       'What steps will you take to encourage contributors to interact with'
       ' your community before, during, and after the program?'))
   encourage_contribs.help_text = contrib_disappears.help_text
 
-  continued_contribs = db.TextProperty(required=True,
-    verbose_name=ugettext(
+  continued_contribs = db.TextProperty(required=True, verbose_name=ugettext(
       'What will you do to ensure that your accepted contributors stick'
       ' with the project after the program concludes?'))
   continued_contribs.help_text = contrib_disappears.help_text
--- a/app/soc/views/models/org_app.py	Thu Feb 05 23:49:46 2009 +0000
+++ b/app/soc/views/models/org_app.py	Thu Feb 05 23:52:27 2009 +0000
@@ -89,6 +89,8 @@
     new_params['create_extra_dynafields'] = {
         'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
                                              required=True),
+        'clean_ideas': cleaning.clean_url('ideas'),
+        'clean_contrib_template': cleaning.clean_url('contrib_template'),
         'clean': cleaning.validate_new_group('link_id', 'scope_path',
             model_logic.organization, org_app_logic)}