Skip to content

Commit

Permalink
singleview: don't show line if field/widget renders empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Mathieu committed Mar 13, 2013
1 parent f65f0de commit 3a09f2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions yaka/web/widgets.py
Expand Up @@ -310,6 +310,15 @@ def render(self, model):
continue

value = Markup(field.render_view())
if value == u'':
# related models may have [] as value, but we don't discard this type
# of value in order to let widget a chance to render something useful
# like an 'add model' button.
#
# if it renders an empty string, there's really no point in rendering
# a line for this empty field
continue

label = self.label_for(field, mapper, name)
data[name] = (label,value,)

Expand Down

0 comments on commit 3a09f2a

Please sign in to comment.