Skip to content
Snippets Groups Projects
Commit 0b3dee84 authored by Pierre LALET's avatar Pierre LALET
Browse files

ls(): support FlagsField in verbose mode

parent a425022b
No related branches found
No related tags found
No related merge requests found
......@@ -1274,6 +1274,12 @@ def ls(obj=None, case_sensitive=False, verbose=False):
"%s: %d" % (strval, numval)
for numval, strval in sorted(cur_i2s.iteritems())
)
elif verbose and isinstance(cur_fld, FlagsField):
names = cur_fld.names
if isinstance(names, basestring):
long_attrs.append(", ".join(names))
else:
long_attrs.append(", ".join(name[0] for name in names))
class_name = "%s (%s)" % (
cur_fld.__class__.__name__,
", ".join(attrs)) if attrs else cur_fld.__class__.__name__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment