Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50094

Display bug with User Category

$
0
0
There's a strange bug in the book details with my alias column.
The name is cutted off, and it happens with this name only.

Edit: additional info

Code:

def evaluate(self, formatter, kwargs, mi, locals, val, col_name, user_cat_prefix):
    new_val = ''
    if hasattr(mi, '_proxy_metadata'):
        all_cats = mi._proxy_metadata.user_categories
        cats = {k:v for k,v in all_cats.items() if k.startswith(user_cat_prefix)}
        SEP = mi.metadata_for_field(col_name)['is_multiple'].get('list_to_ui', '')
        new_val = set()
        if SEP:
            val_ = val.split(SEP)
        else:
            val_ = [val] 
        for user_cat, v in cats.items():
            repl = user_cat.lstrip(user_cat_prefix)
            for user_cat_item, src_cat in v:
                if src_cat == col_name:
                    for item in val_[:]:
                        if item == user_cat_item:
                            new_val.add(repl)
                            val_.remove(item)
                        else:
                            new_val.add(item)
        if new_val:
            return ', '.join(list(new_val))
    return val


Attached Thumbnails
Click image for larger version

Name:	calibre_zNqOvThRIP.jpg
Views:	N/A
Size:	5.7 KB
ID:	191979   Click image for larger version

Name:	calibre_EWeXXHQVqG.jpg
Views:	N/A
Size:	5.2 KB
ID:	191981   Click image for larger version

Name:	calibre_S6O8W3hKRO.jpg
Views:	N/A
Size:	6.8 KB
ID:	191982   Click image for larger version

Name:	knMUiYt6y8.jpg
Views:	N/A
Size:	4.6 KB
ID:	191983   Click image for larger version

Name:	calibre_UNgm7HRiNo.jpg
Views:	N/A
Size:	37.5 KB
ID:	191984  

Viewing all articles
Browse latest Browse all 50094

Latest Images

Trending Articles



Latest Images