If anyone is interested in the widget that was causing this problem and how 
it looks with the fix here you go. All those imports it's because I have it 
in a module called plugin_iconpicker.py

# -*- coding: utf-8 -*-"""Iconpicker 
using:http://victor-valencia.github.io/bootstrap-iconpicker/
Requires bootstrap-iconpicker.css bootstrap-iconpicker.js and the CSS, fontsand 
js iconset files for whatever icons you want to have available as they aren't 
packaged with the plugin. """from gluon.html import CAT, TAG, SCRIPT, INPUTfrom 
gluon.sqlhtml import FormWidgetfrom gluon import current
ICONSETS = ['fontawesome']
class IconPickerWidget(FormWidget):
    _class = 'string'

    @classmethod
    def widget(cls, field, value, **attributes):
        """        Generates an icon picker widget.        """

        default = dict(
            value=(value is not None and str(value)) or '',
        )
        attr = cls._attributes(field, default, **attributes)

        _id = attr['_id']
        _name = attr['_name']

        button = TAG.button(_name=attr['_name'], _id=_id, _type='button', 
_class='btn btn-default') 

        script = SCRIPT("""                        
$(document).ready(function(){$('#%(_id)s').iconpicker({icon:'%(icon)s', 
iconset: '%(iconset)s'});});                        """ % { '_id': _id, 'icon': 
value or '', 'iconset': '|'.join(ICONSETS)})

        # The next 3 lines are here to deal with the idiotic way form.vars is 
filled in web2py
        result = CAT(button, script)
        if current.request.post_vars:
            result.components.append(INPUT(_type='hidden', _name='icon', 
_value=value))

        return result

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to