2016-07-20 36 views
0

所以我有一個要求用戶輸入一個觀點,我想不出做以某種方式遍歷列表,並獲得所有對象的用戶輸入什麼...Django如何遍歷視圖中的對象列表?

def get(self, request, language, word): 
    '''Get reqeust to edit taken in steps''' 
    context = cache.get(word) 
    form_class = DefinitionInfoForm 
    context['form_class'] = form_class 
    return render(request, 
     'study/add_info.html', 
     context_instance=RequestContext(request, context)) 

這裏是我的GET那是在一個CBV裏面。我已加載對象的緩存,我想在同一時間通過他們一個以某種方式重複做一個新的get爲每一個可能的話

OR

做批量廣告,並使其所有形式和修改在POST方法中的所有對象

我用這種形式來添加信息,我無法弄清楚如何使用批量或一次一個做...

class DefinitionInfoForm(forms.Form): 

    part_of_speech = forms.CharField(required=True, label=_(u'Part of Speech')) 
    pronunciation = forms.CharField(required=True, label=_(u'Pronunciation')) 

回答