@@ -76,6 +76,8 @@ def __init__(self, url=None, accessor=None, attrs=None, reverse_args=None, query
76
76
reverse_args (dict, tuple): Arguments to ``django.urls.reverse()``. If dict, the arguments
77
77
are assumed to be keyword arguments to ``reverse()``, if tuple, a ``(viewname, args)``
78
78
or ``(viewname, kwargs)``
79
+ query (dict): If supplied, field-value pairs to be formatted into a query string.
80
+ fragment (str): If supplied, value of URL fragment identifier (hash).
79
81
"""
80
82
self .url = url
81
83
self .attrs = attrs
@@ -177,6 +179,7 @@ def callback(record, value, **kwargs):
177
179
178
180
return callback
179
181
182
+
180
183
@library .register
181
184
class Column :
182
185
"""
@@ -235,8 +238,8 @@ class Column:
235
238
- If `True`, the ``record.get_absolute_url()`` or the related model's
236
239
`get_absolute_url()` is used.
237
240
- If a callable is passed, the returned value is used, if it's not ``None``.
238
- - If a `dict` is passed, optional items named ``query`` (dict), and ``fragment`` (str),
239
- if present, specify the query string and fragment (hash) elements of the url.
241
+ - If a `dict` is passed, optional items named ``query`` (dict), and ``fragment`` (str),
242
+ if present, specify the query string and fragment (hash) elements of the URL.
240
243
The remaining items are passed on to ``~django.urls.reverse`` as kwargs.
241
244
- If a `tuple` is passed, it must be either a (viewname, args) or (viewname, kwargs)
242
245
tuple, which is also passed to ``~django.urls.reverse``.
@@ -327,7 +330,7 @@ def __init__(
327
330
link_kwargs = dict (reverse_args = linkify )
328
331
elif isinstance (linkify , dict ):
329
332
# specific keys in linkify are understood to be link_kwargs, and the rest must be reverse_args
330
- link_kwargs = { name : linkify .pop (name ) for name in ('query' , 'fragment' ) if name in linkify }
333
+ link_kwargs = {name : linkify .pop (name ) for name in ('query' , 'fragment' ) if name in linkify }
331
334
link_kwargs ['reverse_args' ] = linkify
332
335
elif linkify is True :
333
336
link_kwargs = dict (accessor = self .accessor )
0 commit comments