我对varaibles范围有一点问题。 代码:
class Report(django_filters.FilterSet):
def __init__(self):
self.main_fields = []
class Meta:
model = ReportData
fields = self.main_fields
class OtherReport(ReportData):
fields_to_base_class = ['somefields']
class OtherReport2(ReportData):
fields_to_base_class = ['othersomefields']
我该怎么做? Django没有在Meta中看到main_fields。