Skip to content

Commit

Permalink
More typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Dec 21, 2024
1 parent 88f7317 commit e7ef9c6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions django_tables2/columns/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import OrderedDict
from collections.abc import Callable
from itertools import islice
from typing import Union

Expand Down Expand Up @@ -255,7 +256,7 @@ class Blog(models.Model):
.. [1] The provided callable object must not expect to receive any arguments.
"""

# Tracks each time a Column instance is created. Used to retain order.
# Tracks each time a Column instance is created. Used to retain column order.
creation_counter = 0
empty_values = (None, "")

Expand All @@ -268,19 +269,19 @@ class Blog(models.Model):

def __init__(
self,
verbose_name=None,
accessor=None,
default=None,
verbose_name: Union[str, None] = None,
accessor: Union[str, Accessor, Callable[..., str], None] = None,
default: Union[str, None] = None,
visible=True,
orderable=None,
attrs=None,
order_by=None,
empty_values=None,
localize=None,
footer=None,
exclude_from_export=False,
linkify=False,
initial_sort_descending=False,
footer: Union[str, Callable[..., str], None] = None,
exclude_from_export: bool = False,
linkify: Union[bool, list, tuple, Callable[..., str]] = False,
initial_sort_descending: bool = False,
):
if not (accessor is None or isinstance(accessor, str) or callable(accessor)):
raise TypeError(f"accessor must be a string or callable, not {type(accessor).__name__}")
Expand Down

0 comments on commit e7ef9c6

Please sign in to comment.