1
1
from collections import OrderedDict
2
+ from collections .abc import Callable
2
3
from itertools import islice
3
4
from typing import Union
4
5
@@ -255,7 +256,7 @@ class Blog(models.Model):
255
256
.. [1] The provided callable object must not expect to receive any arguments.
256
257
"""
257
258
258
- # Tracks each time a Column instance is created. Used to retain order.
259
+ # Tracks each time a Column instance is created. Used to retain column order.
259
260
creation_counter = 0
260
261
empty_values = (None , "" )
261
262
@@ -268,19 +269,19 @@ class Blog(models.Model):
268
269
269
270
def __init__ (
270
271
self ,
271
- verbose_name = None ,
272
- accessor = None ,
273
- default = None ,
272
+ verbose_name : Union [ str , None ] = None ,
273
+ accessor : Union [ str , Accessor , Callable [..., str ], None ] = None ,
274
+ default : Union [ str , None ] = None ,
274
275
visible = True ,
275
276
orderable = None ,
276
277
attrs = None ,
277
278
order_by = None ,
278
279
empty_values = None ,
279
280
localize = None ,
280
- footer = None ,
281
- exclude_from_export = False ,
282
- linkify = False ,
283
- initial_sort_descending = False ,
281
+ footer : Union [ str , Callable [..., str ], None ] = None ,
282
+ exclude_from_export : bool = False ,
283
+ linkify : Union [ bool , list , tuple , Callable [..., str ]] = False ,
284
+ initial_sort_descending : bool = False ,
284
285
):
285
286
if not (accessor is None or isinstance (accessor , str ) or callable (accessor )):
286
287
raise TypeError (f"accessor must be a string or callable, not { type (accessor ).__name__ } " )
0 commit comments