полученый из базы словарь print cat __dict__ lang de metadata_descript

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
полученый из базы словарь
print cat.__dict__
{'lang': u'de', 'metadata_description': u'asd', 'content_type_id': 6, 'title': u'asd german', 'object_id': 1, 'id': 7, 'short_description': u'asd', 'long_description': u'asd', 'metadata_keywords': u'asd'}
views.py
initial = cat.__dict__
form = CategoryForm(initial=initial)
forms.py
class CategoryForm(forms.Form):
lang = forms.ChoiceField(label=_('Language'), widget=LangSelect, choices=settings.LANGUAGES)
....