mirror of
https://github.com/django-components/django-components.git
synced 2025-08-09 16:57:59 +00:00
Use six to allow metaclass usage in both Python 2 and 3.
This commit is contained in:
parent
f60b443f07
commit
cbe2bcc9c9
2 changed files with 3 additions and 1 deletions
|
@ -1,8 +1,9 @@
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from .component_registry import ComponentRegistry, AlreadyRegistered, NotRegistered # NOQA
|
from .component_registry import ComponentRegistry, AlreadyRegistered, NotRegistered # NOQA
|
||||||
from django.forms.widgets import MediaDefiningClass
|
from django.forms.widgets import MediaDefiningClass
|
||||||
|
from six import with_metaclass
|
||||||
|
|
||||||
class Component(metaclass=MediaDefiningClass):
|
class Component(with_metaclass(MediaDefiningClass)):
|
||||||
def context(self):
|
def context(self):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
django
|
django
|
||||||
|
six
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue