You may be in-advertantly adding these to your model. Please share your pattern, or at least the parts where you are doing either : model.addDisplayAttribute
setting _tw_meta_data_attrs for the Host
1 of 1 people found this helpful
In your if uptime... block all you need is:
host.uptime := uptime;
end if; ...
Also you might want to move your debug log for "uptime" inside the if block where you've checked the existance of a value in it. You can add an else statement maybe saying something like "uptime is null or not set". This will avoid an ugly error in the logs when the value is null.
2 of 2 people found this helpful
The problem is that _tw_meta_data_attrs is a list of strings and you have assigned it a single string.
You should only use model.addDisplayAttribute, it will do the modification to _tw_meta_data_attrs. By modifying it directly you need to be aware that other patterns may have set attributes on the Host.
So the model.addDisplayItem directive actually made the proper display item, and the direct assignment of _tw_meta_data_attrs gave the indiidual (but incorrect) 'u', 'p', 't', 'i', 'm', 'e' things in the display.
It is interesting that _tw_meta_data_attrs took the string and automatically made a list of it rather than complaining the assignment of a string to a list item was incorrect. Is that by design in python or an un-intended feature?
It is an implementation feature of how the UI works that iterating over a string (rather than a list of strings) will produce the individual characters.