Django AutocompleteLight在Python2.7.6下不工作

2024-09-30 20:22:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我的开发环境运行的是python2.7.1,生产环境运行的是2.7.6

下面的代码在开发过程中运行良好,但在生产时不会触发new_city油田的自动完成功能:

管理员py

class LocationAdminForm(autocomplete_light.ModelForm):

    class Media:
        js = ('dependant_autocomplete.js',)


    class Meta:
        model = Location
        fields = ['name', 'instagram_id', 'country', 'new_country', 'city', 'new_city']


class LocationAdmin(admin.ModelAdmin):
    list_display = ['name', 'country', 'city', 'new_country', 'new_city']
    search_fields = ['name', 'new_country', 'new_city']
    list_editable = []
    list_filter = ['new_city', 'new_country']

    form = LocationAdminForm

自动完成-注册表.py

^{pr2}$

你知道这是什么原因吗?或者我该如何排除故障吗?在


Tags: 代码namepycityfieldsnew环境过程