Finish Program
Added some fields, and made TinyMCE the editor for the description
field. Also updated the public page to show these new fields.
We really need generic public views...
Patch by: Sverre Rabbelier
--- a/app/soc/models/program.py Tue Dec 02 18:48:42 2008 +0000
+++ b/app/soc/models/program.py Tue Dec 02 20:10:23 2008 +0000
@@ -21,6 +21,8 @@
]
+from google.appengine.ext import db
+
from django.utils.translation import ugettext_lazy
import soc.models.presence
@@ -30,4 +32,23 @@
"""The Program model, representing a Program ran by a Sponsor
"""
- pass
+ #: Required field storing name of the group.
+ name = db.StringProperty(required=True,
+ verbose_name=ugettext_lazy('Name'))
+ name.help_text = ugettext_lazy('Complete, formal name of the program.')
+
+ #: Required field storing short name of the group.
+ #: It can be used for displaying group as sidebar menu item.
+ short_name = db.StringProperty(required=True,
+ verbose_name=ugettext_lazy('Short name'))
+ short_name.help_text = ugettext_lazy('Short name used for sidebar menu')
+
+ #: Required field storing short name of the group.
+ #: It can be used for displaying group as sidebar menu item.
+ generic_name = db.StringProperty(required=True,
+ verbose_name=ugettext_lazy('Generic name'))
+ generic_name.help_text = ugettext_lazy('Generic Name used to group')
+
+ #: Required field storing description of the group.
+ description = db.TextProperty(required=True,
+ verbose_name=ugettext_lazy('Description'))
--- a/app/soc/templates/soc/program/public.html Tue Dec 02 18:48:42 2008 +0000
+++ b/app/soc/templates/soc/program/public.html Tue Dec 02 20:10:23 2008 +0000
@@ -23,6 +23,9 @@
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
{% readonly_field_as_table_row entity.fields.scope_path.label entity.scope_path %}
+ {% readonly_field_as_table_row entity.fields.name.label entity.name %}
+ {% readonly_field_as_table_row entity.fields.short_name.label entity.short_name %}
+ {% readonly_field_as_table_row entity.fields.generic_name.label entity.generic_name %}
<!-- TODO(pawel.solyga) make this generic -->
</table>
</p>
--- a/app/soc/views/models/program.py Tue Dec 02 18:48:42 2008 +0000
+++ b/app/soc/views/models/program.py Tue Dec 02 20:10:23 2008 +0000
@@ -64,9 +64,11 @@
params['extra_dynaexclude'] = ['home']
params['create_extra_dynafields'] = {
+ 'description': forms.fields.CharField(widget=helper.widgets.TinyMCE(
+ attrs={'rows':10, 'cols':40})),
'scope_path': forms.CharField(widget=forms.HiddenInput,
required=False),
- 'clean_link_id': cleaning.clean_link_id,
+ 'clean_link_id': cleaning.clean_link_id,
}
params = dicts.merge(original_params, params)