no, split does work, and badges are colored along the number of entities just fine.
this is what i use right now:
themelist = groups_theme[idx].split('|')
if len(themelist) > 1:
try:
theme = themelist[groups_count[idx]]
except IndexError:
theme = 'green_badge' # Oops, error badge.1 ;-))
# else:
# theme = 'black_badge' # this will be your default theme
petro
(Petro)
April 16, 2018, 12:35pm
62
Iâm telling you, youâll need the else statement if the group_theme gives you a bad value. If you donât have it, youâll get an AttributeError when that occurs.
Itâs better to be safe.
petro:
youâll need the else statement if the group_theme gives you a bad value. If you donât have it, youâll get an AttributeError when that occurs.
Itâs better to be safe.
a ok, thanks, didnât understand that to be the reason. changed.