[Bug 4769] Add a way to get the whole object in objectlist.Column's format_func
bugzilla-daemon at async.com.br
bugzilla-daemon at async.com.br
Mon Nov 28 10:35:40 BRST 2011
http://bugs.async.com.br/show_bug.cgi?id=4769
Johan Dahlin (not reading bugmail) <jdahlin at async.com.br> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #5803|review?(jdahlin at async.com.b |review-
Flags|r) |
--- Comment #1 from Johan Dahlin (not reading bugmail) <jdahlin at async.com.br> 2011-11-28 10:35:40 BRST ---
Comment on attachment 5803
--> http://bugs.async.com.br/attachment.cgi?id=5803
v1 - romaia
>=== modified file 'kiwi/ui/objectlist.py'
>
> def str2bool(value, from_string=converter.from_string):
>+ - B{extra_data}: object I{None}
>+ - any data to be passed to format_func.
>+ - B{format_func_data}: bool I{False}
>+ - If format_func will receive the row object instead of just the column
>+ value
I think this api is better as;
format_func_data: object - with a default value as None.
If it's none None pass it in as the second argument, that way you don't need
two properties
for the same functionallity.
>- def as_string(self, data):
>+ def as_string(self, obj, data):
This is public API, used by stoqlib/reporting/template.py, to avoid breaking
API, swap the parameter order and add a default value for the added parameter.
>+ """
>+ """
You can finish documenting this now when you added a docstring and everything
:)
--
Configure bugmail: http://bugs.async.com.br/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
More information about the Kiwi
mailing list