Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: attrs must be Attrs object, not dict #67

Closed
brianmay opened this issue Mar 28, 2012 · 1 comment
Closed

DeprecationWarning: attrs must be Attrs object, not dict #67

brianmay opened this issue Mar 28, 2012 · 1 comment

Comments

@brianmay
Copy link
Contributor

Only the default, if nothing specified, is a dict.

Suggest the following change:

diff --git a/django_tables2/columns.py b/django_tables2/columns.py
index ed5c59d..69adc2e 100644
--- a/django_tables2/columns.py
+++ b/django_tables2/columns.py
@@ -86,7 +86,7 @@ class Column(object):
             if orderable is None:
                 orderable = sortable
         self.orderable = orderable
-        attrs = attrs or {}
+        attrs = attrs or Attrs()
         if not isinstance(attrs, Attrs):
             warnings.warn('attrs must be Attrs object, not %s'
                           % type(attrs).__name__, DeprecationWarning)
@bradleyayers
Copy link
Collaborator

Thanks for this, it was a bit of a silly oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants