<commit_before># Create your views here.
from django.views.generic import View
from django.http import Http404
from listable.views  import BaseListableView, Column

from . import models

class StaffList(BaseListableView):

    model = models.Staff

    columns = (
        Column(field="id", ordering=True, filtering=False),
        Column(field="name", ordering="last_name", filtering=True),
        Column(field="department", ordering="department__name", filtering=True),
        Column(field="columns", ordering="department__name", filtering=True),
        Column(field="business", ordering="department__name", filtering=True),
    )

    def name(self, staff):
        return staff.name()

    def department(self, staff):
        return staff.department.name

    def business(self, staff):
        return staff.department.business.name
<commit_msg>fix ordering defs in demo<commit_after># Create your views here.
from django.views.generic import View
from django.http import Http404
from listable.views  import BaseListableView, Column

from . import models

class StaffList(BaseListableView):

    model = models.Staff

    columns = (
        Column(field="id", ordering=True, filtering=False),
        Column(field="name", ordering="last_name", filtering=True),
        Column(field="department", ordering="department__name", filtering=True),
        Column(field="position", ordering="position__name", filtering=True),
        Column(field="business", ordering="department__business__name", filtering=True),
    )

    def name(self, staff):
        return staff.name()

    def department(self, staff):
        return staff.department.name

    def business(self, staff):
        return staff.department.business.name

{'fraction_non_alphanumeric': 0.11220358588779641, 'fraction_numerical': 0.003470213996529786, 'mean_word_length': 4.0144927536231885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '942117', 'n_tokens_mistral': 492, 'n_tokens_neox': 450, 'n_words': 116}