1
我使用django-postman提供用戶到用戶的信息設備,這使用Django的ajax-selects爲用戶名提供autocomplete
設備發送消息時。我需要爲Django用戶聲明一個頻道並將其傳遞給postman
應用程序。這裏是如何做到的。我宣佈一個通道如下圖所示,並如何申報的Django用戶模型查找CHANNEL在Django Ajax的選擇
AJAX_LOOKUP_CHANNELS = {
# pass a dict with the model and the field to search against
'user' : {'model':'django.contrib.auth.User', 'search_field':'username'},
}
在這裏我將它傳遞給postman
應用
POSTMAN_AUTOCOMPLETER_APP = {
'name': 'ajax_select',
'field': 'AutoCompleteField',
'arg_name': 'channel',
'arg_default': 'user', # no default, mandatory to enable the feature
}
但是當我這樣做,我得到一個template syntax error
爲Caught ValueError while rendering: too many values to unpack
任何人可以幫助我知道這裏真的發生了什麼。