1👍
for django1.4, this works
for k,v in SettingsForm().fields.iteritems():
print v.initial
- [Answered ]-Django Pagination with get_absolute_url method
- [Answered ]-Django which is the correct way to store discussion inside db?
- [Answered ]-Django: 1 database shared by N applications
- [Answered ]-Django CMS simple placeholders outside of cms
0👍
You might be able to do something like this:
class SettingsForm(forms.ModelForm):
theme = forms.CharField(required=True, initial='yellow')
defaultinputmessage = forms.CharField(required=True, initial='Type here')
f = SettingsForm(auto_id=False)
print f
Give it a try…
👤Alex
- [Answered ]-Haystack: How to limit SearchQuerySet to a single SearchIndex?
- [Answered ]-Django url r'^page/ should redirect to the same dynamic template whatever argument behind
- [Answered ]-How does django per-site cache work exactly?
- [Answered ]-Using Twilio For East Africa – Kenya, Tanzania, Malawi
Source:stackexchange.com