Comments (4)
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.
@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.
@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.
This issue will solve django-cms/django-cms#7398
from django-classy-tags.
Related Issues (20)
- Releasing a new version with Django 4.2 support
- ``utils.flatten_context`` lacks a test HOT 1
- 0.7.1 introduces error in flattening HOT 5
- Custom default values as input from templates HOT 15
- allow use MultiValueArgument and MultiKeywordArgument together without word_breakpoint HOT 6
- Document AsTag implementation details HOT 4
- Django>=2 support HOT 1
- Django 3 issues - six is no longer availiable in django.utils HOT 17
- license, docs and tests missing from pypi sdist HOT 5
- Distribute newest version on PyPi for Django 3 compatibilty HOT 1
- 2.0.0 installs tests top-level HOT 1
- Next version bump for Django 3.2 support HOT 3
- test_integer_variable fails on Django 4.0
- 3.0.0: Tests not in sdist tarball on pypi.org HOT 4
- RTD maintenance HOT 1
- I probably should no longer have PyPI Access HOT 2
- Bump CodeQL Action to V2 (by Dec 2022)
- The use of setup.py test is deprecated
- 3.0.1: 17 failing tests with TemplateSyntaxError HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-classy-tags.