@@ -62,15 +62,15 @@ def column_for_field(self, field, **kwargs):
6262
6363
6464class LinkTransform :
65- """Object used to generate attributes for the `<a>`-tag to wrap the cell content in."""
66-
6765 viewname = None
6866 accessor = None
6967 attrs = None
7068
7169 def __init__ (self , url = None , accessor = None , attrs = None , reverse_args = None ):
7270 """
73- arguments:
71+ Object used to generate attributes for the `<a>`-tag to wrap the cell content in.
72+
73+ Arguments:
7474 url (callable): If supplied, the result of this callable will be used as ``href`` attribute.
7575 accessor (Accessor): if supplied, the accessor will be used to decide on which object
7676 ``get_absolute_url()`` is called.
@@ -120,9 +120,7 @@ def compose_url(self, **kwargs):
120120 return context .get_absolute_url ()
121121
122122 def call_reverse (self , record ):
123- """
124- Prepares the arguments to reverse() for this record and calls reverse()
125- """
123+ """Prepare the arguments to reverse() for this record and calls reverse()."""
126124
127125 def resolve_if_accessor (val ):
128126 return val .resolve (record ) if isinstance (val , Accessor ) else val
@@ -393,7 +391,7 @@ def order(self, queryset, is_descending):
393391 table or by subclassing `.Column`; but only overrides if second element
394392 in return tuple is True.
395393
396- returns :
394+ Returns :
397395 Tuple (QuerySet, boolean)
398396 """
399397 return (queryset , False )
@@ -404,7 +402,9 @@ def from_field(cls, field, **kwargs):
404402 Return a specialized column for the model field or `None`.
405403
406404 Arguments:
407- field (Model Field instance): the field that needs a suitable column
405+ field (Model Field instance): the field that needs a suitable column.
406+ **kwargs: passed on to the column.
407+
408408 Returns:
409409 `.Column` object or `None`
410410
@@ -429,7 +429,7 @@ class BoundColumn:
429429 In practice, this means that a `.BoundColumn` knows the *"variable name"* given to the `.Column`
430430 when it was declared on the `.Table`.
431431
432- arguments :
432+ Arguments :
433433 table (`~.Table`): The table in which this column exists
434434 column (`~.Column`): The type of column
435435 name (str): The variable name of the column used when defining the
@@ -465,7 +465,6 @@ def attrs(self):
465465 templates easier. ``tf`` is not actually a HTML tag, but this key name
466466 will be used for attributes for column's footer, if the column has one.
467467 """
468-
469468 # prepare kwargs for computed_values()
470469 kwargs = {"table" : self ._table , "bound_column" : self }
471470 # BoundRow.items() sets current_record and current_value when iterating over
@@ -503,25 +502,19 @@ def attrs(self):
503502 return attrs
504503
505504 def _get_cell_class (self , attrs ):
506- """
507- Return a set of the classes from the class key in ``attrs``.
508- """
505+ """Return a set of the classes from the class key in ``attrs``."""
509506 classes = attrs .get ("class" , None )
510507 classes = set () if classes is None else set (classes .split (" " ))
511508
512509 return self ._table .get_column_class_names (classes , self )
513510
514511 def get_td_class (self , td_attrs ):
515- """
516- Returns the HTML class attribute for a data cell in this column
517- """
512+ """Return the HTML class attribute for a data cell in this column."""
518513 classes = sorted (self ._get_cell_class (td_attrs ))
519514 return None if len (classes ) == 0 else " " .join (classes )
520515
521516 def get_th_class (self , th_attrs ):
522- """
523- Returns the HTML class attribute for a header cell in this column
524- """
517+ """Return the HTML class attribute for a header cell in this column."""
525518 classes = self ._get_cell_class (th_attrs )
526519
527520 # add classes for ordering
@@ -539,7 +532,7 @@ def get_th_class(self, th_attrs):
539532
540533 @property
541534 def default (self ):
542- """Returns the default value for this column."""
535+ """Return the default value for this column."""
543536 value = self .column .default
544537 if value is None :
545538 value = self ._table .default
@@ -698,7 +691,7 @@ def visible(self):
698691
699692 @property
700693 def localize (self ):
701- """Return `True`, `False` or `None` as described in ``Column.localize``"""
694+ """Return `True`, `False` or `None` as described in ``Column.localize``. """
702695 return self .column .localize
703696
704697
@@ -742,10 +735,7 @@ def names(self):
742735 return list (self .iternames ())
743736
744737 def iterall (self ):
745- """
746- Return an iterator that exposes all `.BoundColumn` objects,
747- regardless of visibility or sortability.
748- """
738+ """Return an iterator that exposes all `.BoundColumn` objects, regardless of visibility or sortability."""
749739 return (column for name , column in self .iteritems ())
750740
751741 def all (self ):
@@ -759,7 +749,6 @@ def iteritems(self):
759749 consideration all of the ordering and filtering modifiers that a table
760750 supports (e.g. `~Table.Meta.exclude` and `~Table.Meta.sequence`).
761751 """
762-
763752 for name in self ._table .sequence :
764753 if name not in self ._table .exclude :
765754 yield (name , self .columns [name ])
@@ -769,7 +758,7 @@ def items(self):
769758
770759 def iterorderable (self ):
771760 """
772- Same as `BoundColumns.all` but only returns orderable columns .
761+ `BoundColumns.all` filtered for whether they can be ordered .
773762
774763 This is useful in templates, where iterating over the full
775764 set and checking ``{% if column.ordarable %}`` can be problematic in
@@ -780,7 +769,7 @@ def iterorderable(self):
780769
781770 def itervisible (self ):
782771 """
783- Same as `.iterorderable` but only returns visible `.BoundColumn` objects .
772+ Return `.iterorderable` filtered by visibility .
784773
785774 This is geared towards table rendering.
786775 """
@@ -805,7 +794,7 @@ def show(self, name):
805794 self .columns [name ].column .visible = True
806795
807796 def __iter__ (self ):
808- """Convenience API, alias of `.itervisible`."""
797+ """Alias of `.itervisible` (for convenience) ."""
809798 return self .itervisible ()
810799
811800 def __contains__ (self , item ):
0 commit comments