I would like to have an icon or image picker in form where user could choose from a set of predefined icons.
Form would contain a few other fields like a title, text and an icon that would visually mark the topic of the text. Icons could be either pictures in 'static' folder or in 'uploads' (site admin would preload a few icons in a table, something like 'text_topic_symbols' or something similar).
I've tried doing something like this:
db.define_table('topic_icon',
Field('topic_icon_image', 'upload'))
db.define_table('content',
Field('title', 'string', length=256, required=True),
Field('body', 'text', required=True),
Field('topic_type', 'reference topic_icon'))
But then I don'k know how to build a FORM that would show image picker.
Would it be possible to do with web2py or I have to use some javascript magic?