This seems to be very similar to this question. When clicking the link to sort by pass_count I get:
Cannot resolve keyword u'pass_count' into field. Choices are: build, build_no
models.py:
class Run(DashboardBaseModel):
class Meta:
db_table = 'runs'
build_no = models.CharField(max_length=200, db_index = True)
release = models.CharField(max_length=200, db_index = True)
extra_fields = [
'pass_count',
]
@property
def pass_count(self):
passes = 0
for build in self.build_set.all():
passes += build.pass_count
return passes
tables.py:
class CombineTable(tables.Table):
build_no = tables.LinkColumn('run', args=[A('release'), A('id')], verbose_name="Build")
pass_count = tables.Column(verbose_name="Passed", attrs={"td": {"class": "num"}, "th": {"class": "num"}})
Is there a way to work around this?