Fix accessor syntax useage in table column configuration #10857

Closed
opened 2025-12-29 21:36:47 +01:00 by adam · 1 comment
Owner

Originally created by @jnovinger on GitHub (Mar 6, 2025).

Proposed Changes

We have several at least one django_tables.Table sub-class that uses the . notation to specify related objects. This notation was deprecated in django-tables2 v2.2.0 in favor of using the __ notation.

For example, in circuits.tables.CircuitTerminationTable we define a column provider that uses accessor='circuit.provider'. This will become accessor='circuit__provider'.

--> find . -iname "*.py" | xargs rg "accessor=.*[\'\"].*\."
./circuits/tables/circuits.py
114:        accessor='circuit.provider'

Justification

This will have a couple of positive effects:

  • It's required for the django-tables2 3.0 release, so will ease our upgrade path when the time comes.
  • It will eliminate unnecessary chatter in test output.
Originally created by @jnovinger on GitHub (Mar 6, 2025). ### Proposed Changes We have ~~several~~ at least one `django_tables.Table` sub-class that uses the `.` notation to specify related objects. This notation was [deprecated in django-tables2 v2.2.0](https://github.com/jieter/django-tables2/blob/master/CHANGELOG.md#220-2019-11-18) in favor of using the `__` notation. For example, in `circuits.tables.CircuitTerminationTable` we define a column `provider` that uses `accessor='circuit.provider'`. This will become `accessor='circuit__provider'`. ``` --> find . -iname "*.py" | xargs rg "accessor=.*[\'\"].*\." ./circuits/tables/circuits.py 114: accessor='circuit.provider' ``` ### Justification This will have a couple of positive effects: - It's required for the django-tables2 3.0 release, so will ease our upgrade path when the time comes. - It will eliminate unnecessary chatter in test output.
adam added the status: duplicatetype: housekeeping labels 2025-12-29 21:36:47 +01:00
adam closed this issue 2025-12-29 21:36:47 +01:00
Author
Owner

@jnovinger commented on GitHub (Mar 11, 2025):

Fixed in #18858

@jnovinger commented on GitHub (Mar 11, 2025): Fixed in #18858
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10857