【发布时间】:2012-01-25 10:33:36
【问题描述】:
我正在使用django-postman 提供用户对用户的消息功能,这使用 django ajax-selects 在发送消息时为用户名提供autocomplete 功能。我需要为 Django 用户声明一个频道并将其传递给postman 应用程序。这里必须怎么做。我声明了一个频道,如下所示,
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
谁能帮我知道这里到底发生了什么。
【问题讨论】:
标签: ajax django autocomplete django-templates