In current time i rewrote mede a simple widget
but this widget work only for firefox
class MyOptionsWidget(FormWidget):
@staticmethod
def has_options(field):
"""
checks if the field has selectable options
:param field: the field needing checking
:returns: True if the field has options
"""
return hasattr(field.requires, 'options')
@classmethod
def widget(cls, field, value, **attributes):
"""
generates a SELECT tag, including OPTIONs (only 1 option allowed)
see also: :meth:`FormWidget.widget`
"""
default = dict(value=value)
attr = cls._attributes(field, default,
**attributes)
options = db().select(db.provider.ALL)
opts = []
for option in options:
_style='background-image:url("%s"); '
'background-repeat : no-repeat; padding-left: 20px;' %
URL('download', args=option.image)))
return SELECT(*opts, **attr)
вторник, 29 апреля 2014 г., 2:32:42 UTC+5 пользователь Massimo Di Pierro написал: