django admin 站点管理修改 get_queryset

django 站点站点管理修改get_queryset

admin.py修改内容

class FromDataManager(admin.ModelAdmin):
    list_display = ['XZQHBM', 'xian']
    search_fields = ['xian']
    list_per_page = 15

    def get_queryset(self, request):
        return FromData.objects.filter(XZQHBM=653...)


admin.site.register(FromData, FromDataManager)

你可能感兴趣的:(django,python,后端)