[英]Django-admin, SELECT by fields
There is a UserTask
module in which there are very heavy fields and they break the request, how can I remove them from the query for Django Admin. 有一个
UserTask
模块,其中有非常重的字段,它们破坏了请求,我如何从Django Admin查询中删除它们。
They do not appear on the page, but Django uses something like this: 它们没有出现在页面上,但是Django使用了类似这样的东西:
SELECT * FROM UserTask;
And you need: 并且您需要:
SELECT id, name, is_user FROM UserTask;
It is necessary to remove them in the admin area, here is the registration of the model: 有必要在管理区域中将其删除,这是模型的注册:
class UserTaskAdmin(admin.ModelAdmin):
list_filter = ('id', 'name')
list_display = ('id', 'name')
admin.site.register(UserTask, UserTaskAdmin)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.