开发者

Trouble searching User model using django-ajax-selects

I´m using django-ajax-selects in my project, and I can´t make it to work with django.contrib.auth.models.User. All I want to do is search the username field and I don´t know how to put it in my settings.py. What I have now is:

AJAX_LOOKUP_CHANNELS = {
    'to' : dict(model='django.contrib.auth.User', sea开发者_如何学Crch_field='username'),
}

If I search one of my models, like this

AJAX_LOOKUP_CHANNELS = {
    'to' : dict(model='books.Book', search_field='title'),
}

Everything works fine, so I think I just need to know what to put in the model parameter.


Ok, after trying many combinations, mysteriously, this worked:

AJAX_LOOKUP_CHANNELS = {
    'to' : dict(model='auth.User', search_field='username'),
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜