@filter_hook
def get_widgets(self):
    if self.widget_customiz:
        portal_pos = UserSettings.objects.filter(user=self.user, key=self.get_portal_key())
        if len(portal_pos):
            portal_pos = portal_pos[0].value
            widgets = []
            if portal_pos:
                user_widgets = dict([(uw.id, uw) for uw in UserWidget.objects.filter(user=self.user, page_id=self.get_page_id())])
                for col in portal_pos.split('|'):
                    ws = []
                    for wid in col.split(','):
                        try:
                            widget = user_widgets.get(int(wid))
                            if widget:
                                ws.append(self.get_widget(widget))
                        except Exception as e:
                            import logging
                            logging.error(e, exc_info=True)
                    widgets.append(ws)
            return widgets
    return self.get_init_widget()
@filter_hook
def get_widgets(self):
    if self.widget_customiz:
        portal_pos = UserSettings.objects.filter(user=self.user, key=self.get_portal_key())
        if len(portal_pos):
            portal_pos = portal_pos[0].value
            widgets = []
            if portal_pos:
                user_widgets = dict([(uw.id, uw) for uw in UserWidget.objects.filter(user=self.user, page_id=self.get_page_id())])
                for col in portal_pos.split('|'):
                    ws = []
                    for wid in col.split(','):
                        try:
                            widget = user_widgets.get(int(wid))
                            if widget:
                                ws.append(self.get_widget(widget))
                        except Exception as e:
                            import logging
                            logging.error(e, exc_info=True)
                    widgets.append(ws)
            return widgets
    return self.get_init_widget()