@gugahoi:
I can see that you're trying to make the icons list a dropdown. Neat! Let me give you a little background on how the modules system is set up. Hopefully it will help others, too, and the more people that understand the system and want to develop, the better
render_template is a part of Flask - you pass it the file name of the template and whatever variables/objects/whatever you want and it (as you may have guessed) renders the template.
Modules are defined in modules.py, in the array AVAILABLE_MODULES.
*
name is the internal name of the module - basically its ID - and must be unique.
*
label is the title that is displayed in the module when it's on the page.
*
description is the descriptive text used in the "add module" dialog.
*
static defines whether module is static or not. If set to True then it is included on the page on page load, like the applications dialog for example. If a module is static then the poll and delay values are ignored, as it's static, and they won't be exposed to the user in the settings dialog. If a module is not static then it is lazily-loaded after page load using AJAX; this is a good thing as it means that the page will load faster.
*
poll is how frequently the module should be polled (in seconds), and
delay will delay loading of the module. It's quite important to know that these are just the default values for the module - once a user adds the module to the page, we add an entry to the "modules" table which contains information about the module (column, position, poll, delay) and the settings in the database are now used.
* Finally, we have
settings. This describes extra settings that are added as key/value pairs to the "settings" table. An example of extra settings are the API key / username / password fields in the trakt module.
This system allows for most modules to use the same basic code to store settings, edit settings, etc. and makes development a lot easier.
Now, some modules are a bit different because they don't lend themselves very well to key/value settings - Applications is one of these modules because you can have lots of applications added, and creating settings like "application1_name", "application2_name" etc. would gross. To get round this we store applications in their own table, "applications".
Okay, so that's the basics of the module system. I'll split this up into two posts so that this one isn't too long, and will explain how I'd go about making the icon field a dropdown in the next post.