Rename dynafields to dynaproperties
This is to prepare for true dynafields.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/dynaform.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/helper/dynaform.py Sat Feb 21 15:59:07 2009 +0000
@@ -65,7 +65,7 @@
def newDynaForm(dynamodel=None, dynabase=None, dynainclude=None,
- dynaexclude=None, dynafields=None):
+ dynaexclude=None, dynaproperties=None):
"""Creates a new form DynaForm class.
The returned class extends dynabase, but with the following additions:
@@ -76,7 +76,7 @@
* The Meta class has an additional dynaconf field which is set to
the dyanfields keyword argument passed to newDynaForm.
- See DynaFormMetaclass for an explanation on how the dynafields
+ See DynaFormMetaclass for an explanation on how the dynaproperties
property is used to construct the DynaForm class.
"""
@@ -93,16 +93,16 @@
model = dynamodel
include = dynainclude
exclude = dynaexclude
- dynaconf = dynafields
+ dynaconf = dynaproperties
return DynaForm
def extendDynaForm(dynaform, dynainclude=None, dynaexclude=None,
- dynafields=None, append=False):
+ dynaproperties=None, append=False):
"""Extends an existing dynaform.
- If any of dynainclude, dynaexclude or dynafields are not present,
+ If any of dynainclude, dynaexclude or dynaproperties are not present,
they are retrieved from dynaform (if present in it's Meta class).
While it is rather useless to extend from a dynaform that does not have
@@ -137,10 +137,10 @@
# The most interesting parameter, the 'extra fields' dictionary
dynaconf = getattr(meta, 'dynaconf', {})
- if not dynafields:
- dynafields = dynaconf
+ if not dynaproperties:
+ dynaproperties = dynaconf
else:
- dicts.merge(dynafields, dynaconf)
+ dicts.merge(dynaproperties, dynaconf)
# Create a new DynaForm, using the properties we extracted
return newDynaForm(
@@ -148,4 +148,4 @@
dynabase=dynaform,
dynainclude=dynainclude,
dynaexclude=dynaexclude,
- dynafields=dynafields)
+ dynaproperties=dynaproperties)
--- a/app/soc/views/helper/params.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/helper/params.py Sat Feb 21 15:59:07 2009 +0000
@@ -240,27 +240,27 @@
new_params['dynabase'] = helper.forms.BaseForm
- create_dynafields = {
+ create_dynaproperties = {
'clean_link_id': cleaning.clean_link_id('link_id'),
'clean_feed_url': cleaning.clean_feed_url,
}
- create_dynafields.update(params.get('create_extra_dynafields', {}))
+ create_dynaproperties.update(params.get('create_extra_dynaproperties', {}))
new_params['references'] = []
new_params['create_dynainclude'] = [] + params.get('extra_dynainclude', [])
new_params['create_dynaexclude'] = ['scope', 'scope_path'] + \
params.get('extra_dynaexclude', [])
- new_params['create_dynafields'] = create_dynafields
+ new_params['create_dynaproperties'] = create_dynaproperties
- edit_dynafields = {
+ edit_dynaproperties = {
'clean_link_id': cleaning.clean_link_id('link_id'),
'link_id': forms.CharField(widget=helper.widgets.ReadOnlyInput()),
}
- edit_dynafields.update(params.get('edit_extra_dynafields', {}))
+ edit_dynaproperties.update(params.get('edit_extra_dynaproperties', {}))
new_params['edit_dynainclude'] = None
new_params['edit_dynaexclude'] = None
- new_params['edit_dynafields'] = edit_dynafields
+ new_params['edit_dynaproperties'] = edit_dynaproperties
params = dicts.merge(params, new_params)
@@ -293,7 +293,7 @@
logic: The logic value is used to get the model argument to newDynaForm.
create_dynainclude: same as dynabase, but as dynainclude argument
create_dynaexclude: same as dynabase, but as dynaexclude argument
- create_dynafields: same as dynabase, but as dynafields argument
+ create_dynaproperties: same as dynabase, but as dynaproperties argument
"""
create_form = dynaform.newDynaForm(
@@ -301,7 +301,7 @@
dynamodel = model,
dynainclude = params['create_dynainclude'],
dynaexclude = params['create_dynaexclude'],
- dynafields = params['create_dynafields'],
+ dynaproperties = params['create_dynaproperties'],
)
if 'extra_key_order' in params:
@@ -321,14 +321,14 @@
to dyanform.extendDynaForm.
edit_dynainclude: same as create_form, but as dynainclude argument
edit_dynaexclude: same as create_form, but as dynaexclude argument
- edit_dynafields: same as create_form, but as dynafields argument
+ edit_dynaproperties: same as create_form, but as dynaproperties argument
"""
edit_form = dynaform.extendDynaForm(
dynaform = base_form,
dynainclude = params['edit_dynainclude'],
dynaexclude = params['edit_dynaexclude'],
- dynafields = params['edit_dynafields'],
+ dynaproperties = params['edit_dynaproperties'],
)
return edit_form
--- a/app/soc/views/models/club.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/club.py Sat Feb 21 15:59:07 2009 +0000
@@ -94,12 +94,12 @@
new_params['sidebar_additional'] = [
('/' + new_params['url_name'] + '/apply_member', 'Join a Club', 'apply_member'),]
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'clean' : cleaning.validate_new_group('link_id', 'scope_path',
club_logic, club_app_logic)}
# get rid of the clean method
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean' : (lambda x: x.cleaned_data)}
params = dicts.merge(params, new_params)
@@ -114,7 +114,7 @@
applicant_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['applicant_create_form'] = applicant_create_form
--- a/app/soc/views/models/club_admin.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/club_admin.py Sat Feb 21 15:59:07 2009 +0000
@@ -91,7 +91,7 @@
invited_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['invited_create_form'] = invited_create_form
--- a/app/soc/views/models/club_app.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/club_app.py Sat Feb 21 15:59:07 2009 +0000
@@ -70,12 +70,12 @@
new_params['sidebar_grouping'] = 'Clubs'
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'clean': cleaning.validate_new_group('link_id', 'scope_path',
model_logic.club, club_app_logic)}
# get rid of the clean method
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean': (lambda x: x.cleaned_data)}
new_params['name'] = "Club Application"
--- a/app/soc/views/models/club_member.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/club_member.py Sat Feb 21 15:59:07 2009 +0000
@@ -93,7 +93,7 @@
invited_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['invited_create_form'] = invited_create_form
--- a/app/soc/views/models/document.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/document.py Sat Feb 21 15:59:07 2009 +0000
@@ -84,7 +84,7 @@
new_params['sans_link_id_create'] = True
new_params['sans_link_id_list'] = True
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'content': forms.fields.CharField(
widget=helper.widgets.FullTinyMCE(attrs={'rows': 25, 'cols': 100})),
'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
@@ -99,7 +99,7 @@
new_params['extra_dynaexclude'] = ['author', 'created', 'home_for',
'modified_by', 'modified']
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'doc_key_name': forms.fields.CharField(widget=forms.HiddenInput),
'created_by': forms.fields.CharField(widget=helper.widgets.ReadOnlyInput(),
required=False),
--- a/app/soc/views/models/group.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/group.py Sat Feb 21 15:59:07 2009 +0000
@@ -60,7 +60,7 @@
new_params['extra_dynaexclude'] = ['founder','home', 'tos',
'member_template', 'status']
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'founded_by': forms.CharField(widget=widgets.ReadOnlyInput(),
required=False),
}
--- a/app/soc/views/models/group_app.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/group_app.py Sat Feb 21 15:59:07 2009 +0000
@@ -86,7 +86,7 @@
new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status',
'created_on', 'last_modified_on']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'backup_admin_link_id': widgets.ReferenceField(
reference_url='user', required=False,
label=params['logic'].getModel().backup_admin.verbose_name),
@@ -94,7 +94,7 @@
cleaning.clean_users_not_same('backup_admin_link_id'),
}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean_link_id' : cleaning.clean_link_id('link_id'),
}
--- a/app/soc/views/models/host.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/host.py Sat Feb 21 15:59:07 2009 +0000
@@ -80,7 +80,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.CharField(widget=forms.HiddenInput,
required=True),
'clean_link_id': cleaning.clean_existing_user('link_id'),
@@ -105,7 +105,7 @@
invited_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['invited_create_form'] = invited_create_form
--- a/app/soc/views/models/mentor.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/mentor.py Sat Feb 21 15:59:07 2009 +0000
@@ -81,7 +81,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos', 'program']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
required=True),
'mentor_agreement': forms.fields.CharField(required=False,
@@ -111,7 +111,7 @@
invited_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['invited_create_form'] = invited_create_form
--- a/app/soc/views/models/org_admin.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/org_admin.py Sat Feb 21 15:59:07 2009 +0000
@@ -84,7 +84,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos', 'program']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
required=True),
'admin_agreement': forms.fields.CharField(required=False,
@@ -114,7 +114,7 @@
invited_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['invited_create_form'] = invited_create_form
--- a/app/soc/views/models/org_app.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/org_app.py Sat Feb 21 15:59:07 2009 +0000
@@ -96,7 +96,7 @@
new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status',
'created_on', 'last_modified_on']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
required=True),
'admin_agreement': forms.fields.Field(required=False,
@@ -109,7 +109,7 @@
model_logic.organization, org_app_logic)}
# get rid of the clean method
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean': (lambda x: x.cleaned_data)}
new_params['name'] = "Organization Application"
--- a/app/soc/views/models/organization.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/organization.py Sat Feb 21 15:59:07 2009 +0000
@@ -101,7 +101,7 @@
new_params['extra_django_patterns'] = patterns
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.CharField(widget=forms.HiddenInput,
required=True),
'clean_ideas': cleaning.clean_url('ideas'),
@@ -110,7 +110,7 @@
}
# get rid of the clean method
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean': (lambda x: x.cleaned_data)}
params = dicts.merge(params, new_params)
@@ -126,7 +126,7 @@
applicant_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['applicant_create_form'] = applicant_create_form
--- a/app/soc/views/models/presence.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/presence.py Sat Feb 21 15:59:07 2009 +0000
@@ -67,13 +67,13 @@
new_params['extra_dynaexclude'] = ['home']
new_params['home_template'] = 'soc/presence/home.html'
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
# add cleaning of the link id and feed url
'clean_link_id': cleaning.clean_link_id('link_id'),
'clean_feed_url': cleaning.clean_feed_url,
}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'home_link_id': widgets.ReferenceField(
reference_url='document', filter=['scope_path'],
filter_fields={'prefix': params['document_prefix']},
--- a/app/soc/views/models/presence_with_tos.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/presence_with_tos.py Sat Feb 21 15:59:07 2009 +0000
@@ -53,7 +53,7 @@
new_params['extra_dynaexclude'] = ['tos']
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'tos_link_id': widgets.ReferenceField(
reference_url='document', filter=['scope_path'], required=False,
filter_fields={'prefix': params['document_prefix']},
--- a/app/soc/views/models/program.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/program.py Sat Feb 21 15:59:07 2009 +0000
@@ -81,7 +81,7 @@
'mentor_agreement', 'student_agreement']
# TODO add clean field to check for uniqueness in link_id and scope_path
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'description': forms.fields.CharField(widget=helper.widgets.TinyMCE(
attrs={'rows':10, 'cols':40})),
'scope_path': forms.CharField(widget=forms.HiddenInput, required=True),
@@ -113,7 +113,7 @@
result['workflow'] = forms.CharField(widget=widgets.ReadOnlyInput(),
required=True)
- new_params['edit_extra_dynafields'] = result
+ new_params['edit_extra_dynaproperties'] = result
references = [
--- a/app/soc/views/models/request.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/request.py Sat Feb 21 15:59:07 2009 +0000
@@ -87,14 +87,14 @@
new_params['extra_dynaexclude'] = ['status', 'role_verbose']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'link_id': widgets.ReferenceField(reference_url='user'),
'role': forms.CharField(widget=widgets.ReadOnlyInput(),
required=True),
'clean_link_id': cleaning.clean_existing_user('link_id'),
}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'scope_path': forms.CharField(widget=forms.HiddenInput,
required=True),
}
@@ -123,7 +123,7 @@
request_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
params['request_form'] = request_form
--- a/app/soc/views/models/role.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/role.py Sat Feb 21 15:59:07 2009 +0000
@@ -133,7 +133,7 @@
new_params['create_template'] = 'soc/role/edit.html'
new_params['edit_template'] = 'soc/role/edit.html'
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'latitude':forms.fields.FloatField(widget=forms.HiddenInput,
required=False),
'longitude': forms.fields.FloatField(widget=forms.HiddenInput,
--- a/app/soc/views/models/site.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/site.py Sat Feb 21 15:59:07 2009 +0000
@@ -71,11 +71,11 @@
new_params['edit_template'] = 'soc/site/edit.html'
new_params['home_template'] = 'soc/site/home.html'
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'link_id': forms.CharField(widget=forms.HiddenInput, required=True),
'clean_noreply_email': cleaning.clean_empty_field('noreply_email'),
}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'link_id': forms.CharField(widget=forms.HiddenInput, required=True),
'home_link_id': widgets.ReferenceField(
reference_url='document', required=False,
--- a/app/soc/views/models/student.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/student.py Sat Feb 21 15:59:07 2009 +0000
@@ -89,7 +89,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos', 'school']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'scope_path': forms.fields.CharField(widget=forms.HiddenInput,
required=True),
'student_agreement': forms.fields.CharField(required=False,
@@ -114,7 +114,7 @@
user_create_form = dynaform.extendDynaForm(
dynaform = self._params['create_form'],
- dynafields = updated_fields)
+ dynaproperties = updated_fields)
self._params['user_create_form'] = user_create_form
--- a/app/soc/views/models/student_proposal.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/student_proposal.py Sat Feb 21 15:59:07 2009 +0000
@@ -86,7 +86,7 @@
new_params['extra_dynaexclude'] = ['org', 'program', 'score',
'status', 'mentor', 'link_id']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'content': forms.fields.CharField(required=True,
widget=widgets.FullTinyMCE(attrs={'rows': 25, 'cols': 100})),
'scope_path': forms.CharField(widget=forms.HiddenInput,
@@ -99,7 +99,7 @@
'scope_path', student_logic, org_logic),
}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'organization': forms.CharField(label='Organization Link ID',
widget=widgets.ReadOnlyInput),
'link_id': forms.CharField(widget=forms.HiddenInput)
--- a/app/soc/views/models/timeline.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/timeline.py Sat Feb 21 15:59:07 2009 +0000
@@ -64,7 +64,7 @@
new_params['django_patterns_defaults'] = patterns
- new_params['edit_dynafields'] = []
+ new_params['edit_dynaproperties'] = []
params = dicts.merge(params, new_params)
@@ -85,7 +85,7 @@
dynaform = create_form,
dynainclude = self._params['edit_dynainclude'],
dynaexclude = self._params['edit_dynaexclude'],
- dynafields = fields,
+ dynaproperties = fields,
)
self._params['edit_form_%s' % name] = edit_form
--- a/app/soc/views/models/user.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/user.py Sat Feb 21 15:59:07 2009 +0000
@@ -74,7 +74,7 @@
new_params['extra_dynaexclude'] = ['former_accounts', 'agreed_to_tos',
'agreed_to_tos_on', 'status']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'clean_link_id': cleaning.clean_user_not_exist('link_id'),
'clean_account': cleaning.clean_user_account_not_in_use('account')}
@@ -83,7 +83,7 @@
for choice in user_logic.getModel().status.choices:
status_choices.append((choice, choice))
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'link_id': forms.CharField(widget=widgets.ReadOnlyInput(),
required=True),
'clean_link_id': cleaning.clean_link_id('link_id'),
--- a/app/soc/views/models/user_self.py Sat Feb 21 15:57:02 2009 +0000
+++ b/app/soc/views/models/user_self.py Sat Feb 21 15:59:07 2009 +0000
@@ -92,11 +92,11 @@
new_params['extra_dynaexclude'] = ['former_accounts',
'account', 'is_developer', 'status', 'agreed_to_tos_on']
- new_params['create_extra_dynafields'] = {
+ new_params['create_extra_dynaproperties'] = {
'clean_agreed_to_tos': cleaning.clean_agrees_to_tos('agreed_to_tos'),
'clean_link_id': cleaning.clean_user_not_exist('link_id'),}
- new_params['edit_extra_dynafields'] = {
+ new_params['edit_extra_dynaproperties'] = {
'clean_link_id': cleaning.clean_link_id('link_id'),
'agreed_to_tos_on': forms.DateTimeField(
widget=widgets.ReadOnlyInput(attrs={'disabled':'true'}),