'Sets choices and initial value'

def __init__(self, user, *args, **kwargs):

    super(SettingsForm, self).__init__(*args, **kwargs)
    self.user = user
    self.fields['default_contact_type'].label = _('Default    Contact    Type')
    self.fields['default_contact_type'].queryset = Object.filter_permitted(user, ContactType.objects, mode='x')
    try:
        conf = ModuleSetting.get_for_module('treeio.messaging', 'default_contact_type', user=user)[0]
        default_contact_type = ContactType.objects.get(pk=long(conf.value))
        self.fields['default_contact_type'].initial = default_contact_type.id
    except:
        pass
    self.fields['default_imap_folder'].label = _('Default    IMAP    Folder')
    try:
        conf = ModuleSetting.get_for_module('treeio.messaging', 'default_imap_folder', user=user)[0]
        self.fields['default_imap_folder'].initial = conf.value
    except:
        self.fields['default_imap_folder'].initial = settings.HARDTREE_MESSAGING_IMAP_DEFAULT_FOLDER_NAME
    self.fields['signature'].label = _('Signature')
    try:
        conf = ModuleSetting.get_for_module('treeio.messaging', 'signature', user=user, strict=True)[0]
        signature = conf.value
        self.fields['signature'].initial = signature
    except:
        pass
