mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Decorator syntax for registering specs
This commit is contained in:
parent
722a553501
commit
938acedcc7
1 changed files with 6 additions and 1 deletions
|
|
@ -94,7 +94,12 @@ def spec(parser, token):
|
|||
spec = spec_tag = register.tag(spec)
|
||||
|
||||
|
||||
def _register_spec(id, spec):
|
||||
def _register_spec(id, spec=None):
|
||||
if not spec:
|
||||
def decorator(cls):
|
||||
spec_registry.register(id, cls)
|
||||
return cls
|
||||
return decorator
|
||||
spec_registry.register(id, spec)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue