Permalink
Browse files

Display the onetoone field in a label when we view the data. In this …

…way the HTML table is not too big according to the DB.
  • Loading branch information...
1 parent f4b7cac commit e97c342851d77033bdc0c985f7e6202991ed2371 @LeResKP LeResKP committed Aug 26, 2013
Showing with 2 additions and 17 deletions.
  1. +1 −16 tests/test_widgets.py
  2. +1 −1 tw2/sqla/factory.py
View
@@ -1238,22 +1238,7 @@ def test_request_get(self):
<span>bob1<input type="hidden" name="autolistpage_d:0:name" value="bob1" id="autolistpage_d:0:name"/></span>
</td>
<td>
- <fieldset id="autolistpage_d:0:account:fieldset">
- <legend></legend>
- <table id="autolistpage_d:0:account">
- <tr class="odd required" id="autolistpage_d:0:account:account_name:container">
- <th><label for="account_name">Account Name</label></th>
- <td >
- <span>account1<input type="hidden" name="account:account_name" value="account1" id="autolistpage_d:0:account:account_name"/></span>
-
- <span id="autolistpage_d:0:account:account_name:error"></span>
- </td>
- </tr>
- <tr class="error"><td colspan="2">
- <span id="autolistpage_d:0:account:error"></span>
- </td></tr>
- </table>
- </fieldset>
+ <span>account1<input type="hidden" name="autolistpage_d:0:account" value="account1" id="autolistpage_d:0:account"/></span>
</td>
<td>
</td>
View
@@ -372,7 +372,7 @@ def post_define(cls):
# This is assigned here and not above because of a circular dep.
ViewPolicy.onetomany_widget = DbListLinkField
-ViewPolicy.onetoone_widget = AutoViewFieldSet
+ViewPolicy.onetoone_widget = twf.LabelField
EditPolicy.onetoone_widget = AutoEditFieldSet
class AutoListPage(DbListPage):

0 comments on commit e97c342

Please sign in to comment.