GithubHelp home page GithubHelp logo

Comments (4)

kevinmarsh avatar kevinmarsh commented on September 27, 2024 1

Just getting back to this, think actually we might not even need if django_lt_41, might just be able to modify the name param for the metaclass

- return super().__new__(cls, name, bases, attrs)
+ return super().__new__(cls, tag_name, bases, attrs)

If you merge #85 I'll push a PR on top of that which passes on Django 2.2-4.1 (and main branch) and can discuss implementation more there (as there are drawbacks to that potentially unavoidable approach)

from django-classy-tags.

marksweb avatar marksweb commented on September 27, 2024

@kevinmarsh Thanks for raising. I've not made it to 4.0 yet so a long way from catching this one.

If I've understood this correctly, we could do something to check if django<4.1 and vary the attribute set;

    def __new__(cls, name, bases, attrs): 
        parents = [base for base in bases if isinstance(base, TagMeta)] 
        if not parents: 
            return super().__new__(cls, name, bases, attrs) 
        tag_name = str(attrs.get('name', get_default_name(name))) 
  
        if django_lt_41:

            def fake_func(): 
                pass  # pragma: no cover 
  
            fake_func.__name__ = tag_name 
            attrs['_decorated_function'] = fake_func 

        else:
            attrs['__name__'] = tag_name

from django-classy-tags.

marksweb avatar marksweb commented on September 27, 2024

@kevinmarsh I've merged #85 (sorry for the delay!)

In terms of moving forward with this, I'm more than happy to drop Django 2.2 as its no longer supported.

from django-classy-tags.

fsbraun avatar fsbraun commented on September 27, 2024

This issue will solve django-cms/django-cms#7398

from django-classy-tags.

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.