Skip to content

Commit

Permalink
Display the onetoone field in a label when we view the data. In this …
Browse files Browse the repository at this point in the history
…way the HTML table is not too big according to the DB.
  • Loading branch information
LeResKP committed Sep 5, 2013
1 parent f4b7cac commit e97c342
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions tests/test_widgets.py
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tw2/sqla/factory.py
Expand Up @@ -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):
Expand Down

0 comments on commit e97c342

Please sign in to comment.