Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ The @task Decorator

from django_ztask.decorators import task

The `@task()` decorator will turn any normal function in to a
The `@task` decorator will turn any normal function in to a
`django_ztask` task if called using one of the function extensions.

Function extensions
Expand Down Expand Up @@ -172,7 +172,7 @@ Example

from django_ztask.decorators import task

@task()
@task
def print_this(what_to_print):
print what_to_print

Expand Down
5 changes: 4 additions & 1 deletion django_ztask/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import types

def task():
def task(function=None):
from django_ztask.conf import settings
try:
from zmq import PUSH
Expand Down Expand Up @@ -63,4 +63,7 @@ def _func_after(*args, **kwargs):
setattr(func, 'after', _func_after)
return func

if function:
return wrapper(function)

return wrapper