简体   繁体   English

使用django-tables2跳过列

[英]Skip column with django-tables2

I want to avoid the ID being displayed. 我想避免显示ID。

I am probably missing something obvious, but I can not find int in the documentation 我可能缺少明显的东西,但是在文档中找不到int

I have tried explicitly listing all columns except the ones I want to skip by using: 我尝试使用以下方式显式列出所有列,但要跳过的列除外:

class Meta:
    model = Campaign
    sequence = ("name", "vendor_name", "vendor_email")

But the row id is still being shown. 但是行ID仍在显示。 How can I prevent that? 我该如何预防?

I have also tried exclude , and it did not work. 我也尝试了exclude ,但没有用。

The solution was to specify both sequence (for the ordering) and fields (for exhaustive listing). 解决方案是同时指定顺序(用于订购)和字段 (用于详尽列出)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM