Define a key order for document and org app
authorSverre Rabbelier <srabbelier@gmail.com>
Thu, 12 Mar 2009 21:38:40 +0000
changeset 1813 5cc9e055a818
parent 1812 a0ab93cc3cd5
child 1814 0c4fd663704b
Define a key order for document and org app This way the export order will be constant, even if we add more model properties later on. Patch by: Sverre Rabbelier
app/soc/views/models/document.py
app/soc/views/models/org_app.py
--- a/app/soc/views/models/document.py	Thu Mar 12 21:38:07 2009 +0000
+++ b/app/soc/views/models/document.py	Thu Mar 12 21:38:40 2009 +0000
@@ -69,6 +69,9 @@
     new_params['export_extension'] = '.html'
     new_params['export_function'] = lambda x: (x.content, x.link_id)
     new_params['delete_redirect'] = '/'
+    new_params['list_key_order'] = [
+        'link_id', 'scope_path', 'name', 'short_name', 'title',
+        'content', 'prefix','read_access','write_access']
 
     new_params['no_create_raw'] = True
     new_params['no_create_with_scope'] = True
--- a/app/soc/views/models/org_app.py	Thu Mar 12 21:38:07 2009 +0000
+++ b/app/soc/views/models/org_app.py	Thu Mar 12 21:38:40 2009 +0000
@@ -85,6 +85,14 @@
 
     new_params['sidebar_grouping'] = 'Organizations'
 
+    new_params['list_key_order'] = [
+        'link_id', 'scope_path', 'name', 'home_page', 'email',
+        'description', 'why_applying','pub_mailing_list','irc_channel',
+        'member_criteria', 'prior_participation', 'prior_application',
+        'license_name', 'ideas', 'dev_mailing_list', 'contrib_template',
+        'contrib_disappears', 'member_disappears', 'encourage_contribs',
+        'continued_contribs']
+
     patterns = [(r'^%(url_name)s/(?P<access_type>apply)/%(scope)s$',
         'soc.views.models.%(module_name)s.create',
         'Create an %(name_plural)s'),