Added feed_url to StudentProject.
authorLennard de Rijk <ljvderijk@gmail.com>
Tue, 07 Apr 2009 21:55:54 +0000
changeset 2122 b709f9d1566a
parent 2121 4f6344dfab28
child 2123 31a1e8e7eb18
Added feed_url to StudentProject. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/models/student_project.py
app/soc/views/models/student_project.py
--- a/app/soc/models/student_project.py	Tue Apr 07 21:40:23 2009 +0000
+++ b/app/soc/models/student_project.py	Tue Apr 07 21:55:54 2009 +0000
@@ -52,6 +52,13 @@
   additional_info.help_text = ugettext(
       'Link to a resource containing more information about this project.')
 
+  #: Optional field storing a feed URL; displayed publicly.
+  feed_url = db.LinkProperty(
+      verbose_name=ugettext('Project Feed URL'))
+  feed_url.help_text = ugettext(
+      'The URL should be a valid ATOM or RSS feed. '
+      'Feed entries are shown on the home page.')
+
   #: A property containing which mentor has been assigned to this project.
   #: A project must have a mentor at all times
   mentor = db.ReferenceProperty(reference_class=soc.models.mentor.Mentor,
--- a/app/soc/views/models/student_project.py	Tue Apr 07 21:40:23 2009 +0000
+++ b/app/soc/views/models/student_project.py	Tue Apr 07 21:55:54 2009 +0000
@@ -103,6 +103,7 @@
         'clean_student': cleaning.clean_link_id('student'),
         'clean_mentor': cleaning.clean_link_id('mentor'),
         'clean_additional_info': cleaning.clean_url('additional_info'),
+        'clean_feed_url': cleaning.clean_feed_url,
         'clean': cleaning.validate_student_project('scope_path',
             'mentor_id', 'student_id')
         }
@@ -138,6 +139,7 @@
     dynaproperties = {
         'clean_abstract': cleaning.clean_content_length('abstract'),
         'clean_additional_info': cleaning.clean_url('additional_info'),
+        'clean_feed_url': cleaning.clean_feed_url,
         }
 
     student_edit_form = dynaform.newDynaForm(