'Sets choices and initial value'

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

    super(SettingsForm, self).__init__(*args, **kwargs)
    self.fields['my_company'].queryset = Object.filter_permitted(user, Contact.objects)
    self.fields['my_company'].widget.attrs.update({'class': 'autocomplete', 'callback': reverse('identities_ajax_contact_lookup')})
    self.fields['default_account'].queryset = Object.filter_permitted(user, Account.objects)
    self.fields['default_currency'].label = _('Base    Currency')
    self.fields['my_company'].label = _('My    Company')
    self.fields['default_account'].label = _('Default    Account')
    try:
        self.fields['default_currency'].widget.attrs.update({'popuplink': reverse('finance_currency_add')})
        self.fields['default_currency'].queryset = Currency.objects.all()
        self.fields['default_currency'].initial = Currency.objects.get(is_default=True)
    except Exception:
        pass
    try:
        conf = ModuleSetting.get_for_module('treeio.finance', 'my_company')[0]
        my_company = Contact.objects.get(pk=long(conf.value))
        self.fields['my_company'].initial = my_company.id
    except Exception:
        pass
    try:
        conf = ModuleSetting.get_for_module('treeio.finance', 'default_account')[0]
        default_account = Account.objects.get(pk=long(conf.value))
        self.fields['default_account'].initial = default_account.id
    except Exception:
        pass
