Rename the User.public_name Property to simply 'name' (but leave the verbose
authorTodd Larsen <tlarsen@google.com>
Sat, 22 Nov 2008 08:55:55 +0000
changeset 546 850d9a5ad894
parent 545 217921e76f50
child 547 be0de865ffc9
Rename the User.public_name Property to simply 'name' (but leave the verbose name as "Public name"). This is to take advantage of standardizing on 'name' in the common edit template (and possibly other common templates). The Property was renamed because public_name was already a "name", unlike the recent change to the Work Model class, where 'title' was "aliases" using a tiny name() method instead. Patch by: Todd Larsen
app/soc/models/user.py
app/soc/templates/soc/document/public.html
app/soc/templates/soc/host/public.html
app/soc/templates/soc/user/edit.html
app/soc/templates/soc/user/edit_self.html
app/soc/templates/soc/user/list/user_row.html
app/soc/templates/soc/user/lookup.html
app/soc/templates/soc/user/public.html
app/soc/views/models/user.py
--- a/app/soc/models/user.py	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/models/user.py	Sat Nov 22 08:55:55 2008 +0000
@@ -77,9 +77,9 @@
   #: Required field storing publicly-displayed name.  Can be a real name
   #: (though this is not recommended), or a nick name or some other public
   #: alias.  Public names can be any valid UTF-8 text.
-  public_name = db.StringProperty(required=True,
+  name = db.StringProperty(required=True,
       verbose_name=ugettext_lazy('Public name'))
-  public_name.help_text = ugettext_lazy(
+  name.help_text = ugettext_lazy(
       'Human-readable name (UTF-8) that will be displayed publicly on the'
       ' site. While you can use your real name, like "First Last", please'
       ' keep in mind that this "public name" will be used as your alias'
--- a/app/soc/templates/soc/document/public.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/document/public.html	Sat Nov 22 08:55:55 2008 +0000
@@ -22,6 +22,6 @@
 {% endblock %}
 
 {% block body %}
-<div id="created">Created on {{ entity.created }} by {{ entity.author.public_name }}</div>
+<div id="created">Created on {{ entity.created }} by {{ entity.author.name }}</div>
 <div id="content">{{ entity.content|safe }}</div>
 {% endblock %}
--- a/app/soc/templates/soc/host/public.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/host/public.html	Sat Nov 22 08:55:55 2008 +0000
@@ -15,7 +15,7 @@
 {% load forms_helpers %}
 
 {% block header_title %}
-{{ page_name }} for {{ entity.user.public_name }} ({{ entity.given_name }} {{ entity.surname }})
+{{ page_name }} for {{ entity.user.name }} ({{ entity.given_name }} {{ entity.surname }})
 {% endblock %}
 
 {% block body %}
--- a/app/soc/templates/soc/user/edit.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/user/edit.html	Sat Nov 22 08:55:55 2008 +0000
@@ -16,7 +16,7 @@
 {% block header_title %}
  {{ page_name }}
  {% if existing_user %}
-for {{ existing_user.public_name }}
+for {{ existing_user.name }}
 <a href="mailto:{{ existing_user.account.email }} ">&lt;{{ existing_user.account.email }}&gt;</a>
  {% endif %}
 {% endblock %}
@@ -43,7 +43,7 @@
 </tr>
 {% endif %}
   {% field_as_table_row form.link_id %}
-  {% field_as_table_row form.public_name %}
+  {% field_as_table_row form.name %}
   {% field_as_table_row form.is_developer %}
   {% if existing_user.former_accounts %}
   <tr>
--- a/app/soc/templates/soc/user/edit_self.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/user/edit_self.html	Sat Nov 22 08:55:55 2008 +0000
@@ -16,7 +16,7 @@
 {% block page_title %}User Profile{% endblock %}
 {% block header_title %}
 {% if user %}
-Modify Existing User Profile for {{ user.public_name }} <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
+Modify Existing User Profile for {{ user.name }} <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
 {% else %}
 Create a New User Profile for <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
 {% endif %}
@@ -30,7 +30,7 @@
 </p>
 <form method="POST">
  <table>
-  {% field_as_table_row form.public_name %}
+  {% field_as_table_row form.name %}
   {% field_as_table_row form.link_id %}
   <tr>
    <td colspan="4">&nbsp;</td>
--- a/app/soc/templates/soc/user/list/user_row.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/user/list/user_row.html	Sat Nov 22 08:55:55 2008 +0000
@@ -5,6 +5,6 @@
      </div>
   </td>
   <td><div class="email">{{ list.item.account.email }}</a></div></td>
-  <td><div class="public_name">{{ list.item.public_name }}</div></td>
+  <td><div class="name">{{ list.item.name }}</div></td>
   <td><div class="link_id">{{ list.item.link_id }}</div></td>
 </tr>
--- a/app/soc/templates/soc/user/lookup.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/user/lookup.html	Sat Nov 22 08:55:55 2008 +0000
@@ -46,7 +46,7 @@
 {% if found_user %}
  <tr>
   <td class="formfieldlabel">Public name</td>
-  <td>{{ found_user.public_name }}</td>
+  <td>{{ found_user.name }}</td>
   <td class="formfieldrequired">&nbsp;</td>
   <td class="formfieldhelptext">&nbsp;</td>
  </tr>
@@ -88,7 +88,7 @@
   </tr>
   <tr>
    <td colspan="4">
-    <a href="{{ edit_link }}">Edit the User profile of {{ found_user.public_name }}.</a>
+    <a href="{{ edit_link }}">Edit the User profile of {{ found_user.name }}.</a>
    </td>
   </tr>
 {% endif %}
--- a/app/soc/templates/soc/user/public.html	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/templates/soc/user/public.html	Sat Nov 22 08:55:55 2008 +0000
@@ -15,14 +15,14 @@
 {% load forms_helpers %}
 
 {% block header_title %}
-{{ page_name }} for {{ entity.public_name }}
+{{ page_name }} for {{ entity.name }}
 {% endblock %}
 
 {% block body %}
 <p>
  <table>
   {% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
-  {% readonly_field_as_table_row entity.fields.public_name.label entity.public_name %}
+  {% readonly_field_as_table_row entity.fields.name.label entity.name %}
   <!-- TODO(pawel.solyga) make this generic -->
  </table>
 </p>
--- a/app/soc/views/models/user.py	Sat Nov 22 08:44:54 2008 +0000
+++ b/app/soc/views/models/user.py	Sat Nov 22 08:55:55 2008 +0000
@@ -53,8 +53,8 @@
       label=soc.models.user.User.link_id.verbose_name,
       help_text=soc.models.user.User.link_id.help_text)
 
-  public_name = forms.CharField(
-      label=soc.models.user.User.public_name.verbose_name)
+  name = forms.CharField(
+      label=soc.models.user.User.name.verbose_name)
 
   is_developer = forms.BooleanField(required=False,
       label=soc.models.user.User.is_developer.verbose_name,
@@ -228,7 +228,7 @@
         new_link_id = form.cleaned_data.get('link_id')
         properties = {
           'link_id': new_link_id,
-          'public_name': form.cleaned_data.get("public_name"),
+          'name': form.cleaned_data.get("name"),
           'account': account,
         }