mirror of
https://github.com/django-components/django-components.git
synced 2025-07-17 13:34:58 +00:00
Remove support for Python < 3.6 and Django < 2.2.
This commit is contained in:
parent
ab7e97658f
commit
2c95b0930f
6 changed files with 22 additions and 67 deletions
|
@ -4,7 +4,7 @@ from itertools import chain
|
|||
|
||||
from django.conf import settings
|
||||
from django.forms.widgets import MediaDefiningClass
|
||||
from django.template.base import NodeList
|
||||
from django.template.base import NodeList, TokenType
|
||||
from django.template.loader import get_template
|
||||
from django.utils.safestring import mark_safe
|
||||
from six import with_metaclass
|
||||
|
@ -12,17 +12,6 @@ from six import with_metaclass
|
|||
# Allow "component.AlreadyRegistered" instead of having to import these everywhere
|
||||
from django_components.component_registry import AlreadyRegistered, ComponentRegistry, NotRegistered # noqa
|
||||
|
||||
# Django < 2.1 compatibility
|
||||
try:
|
||||
from django.template.base import TokenType
|
||||
except ImportError:
|
||||
from django.template.base import TOKEN_BLOCK, TOKEN_TEXT, TOKEN_VAR
|
||||
|
||||
class TokenType:
|
||||
TEXT = TOKEN_TEXT
|
||||
VAR = TOKEN_VAR
|
||||
BLOCK = TOKEN_BLOCK
|
||||
|
||||
|
||||
class Component(with_metaclass(MediaDefiningClass)):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue