Merge "Minor refactor of dynamic_ui modules"

This commit is contained in:
Jenkins 2014-04-29 16:07:29 +00:00 committed by Gerrit Code Review
commit 6574215468
2 changed files with 6 additions and 13 deletions

View File

@ -360,7 +360,7 @@ class TableWidget(floppyforms.widgets.Input):
# FixME: we need to use this hack because TableField passes all kwargs
# to TableWidget
for kwarg in ('widget', 'description', 'description_title'):
ignorable = kwargs.pop(kwarg, None)
kwargs.pop(kwarg, None)
super(TableWidget, self).__init__(*args, **kwargs)
def get_context(self, name, value, attrs=None):

View File

@ -46,19 +46,12 @@ def decamelize(name):
return '_'.join([bit.lower() for bit in bits])
def explode(string):
def explode(_string):
"""Explodes a string into a list of one-character strings."""
if not string:
return string
bits = []
while True:
head, tail = string[0], string[1:]
bits.append(head)
if tail:
string = tail
else:
break
return bits
if not _string or not isinstance(_string, basestring):
return _string
else:
return list(_string)
def prepare_regexp(regexp):