GithubHelp home page GithubHelp logo

Comments (3)

wking avatar wking commented on August 29, 2024

Also, the current code also clobbers value. Fix with:

--- a/django_tables2/columns.py
+++ b/django_tables2/columns.py
@@ -239,9 +239,9 @@ class LinkColumn(Column):
                               for a in self.args]
         if self.kwargs:
             params['kwargs'] = self.kwargs
-            for key, value in self.kwargs.items():
-                if isinstance(value, A):
-                    params['kwargs'][key] = value.resolve(record)
+            for key, value_ in self.kwargs.items():
+                if isinstance(value_, A):
+                    params['kwargs'][key] = value_.resolve(record)
         if self.current_app:
             params['current_app'] = self.current_app
             for key, value in self.current_app:

or get both fixes by pulling my Git branch.

from django-tables2.

wking avatar wking commented on August 29, 2024

Also, the current code clobbers self.kwargs when resolving Accessors. Fix with:

--- a/django_tables2/columns.py
+++ b/django_tables2/columns.py
@@ -238,10 +238,12 @@ class LinkColumn(Column):
             params['args'] = [a.resolve(record) if isinstance(a, A) else a
                               for a in self.args]
         if self.kwargs:
-            params['kwargs'] = self.kwargs
+            params['kwargs'] = {}
             for key, value_ in self.kwargs.items():
                 if isinstance(value_, A):
                     params['kwargs'][key] = value_.resolve(record)
+                else:
+                    params['kwargs'][key] = value_
         if self.current_app:
             params['current_app'] = self.current_app
             for key, value in self.current_app:

or get all of this by puling my Git branch.

from django-tables2.

bradleyayers avatar bradleyayers commented on August 29, 2024

It's a pretty silly bug for me to have made. I tried pulling your master branch into development, but it did not end well :( There was also some crazy going on in the current_app handling. It should all be fixed now, I wrote a unit test for it too. Thanks for reporting this + providing fix :)

from django-tables2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.