def __init__(self, request, *args, **kwargs): super(PrefUIForm, self).__init__(*args, **kwargs) prefs = request.user.prefs for k in prefs.ui: if k in self.fields: self.fields[k].initial = prefs.ui[k] # self.fields['layeredthemes'].choices = self.fields['theme'].choices self.fields["theme"].choices = [(t, t) for t in ui_themes()]
def __init__(self, request, *args, **kwargs): super(PrefUIForm, self).__init__(*args, **kwargs) prefs = request.user.prefs for k in prefs.ui: if k in self.fields: self.fields[k].initial = prefs.ui[k] # self.fields['layeredthemes'].choices = self.fields['theme'].choices self.fields['theme'].choices = [(t, t) for t in ui_themes()]