Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
valdergallo committed Jun 4, 2014
1 parent 8a6082e commit 4c11165
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ Shell
Using with Celery
-----------------

By default compress_field use Celery if Celery are installed on Site Packages.
You just need create one post_save on your model to start compress. If you wanna
auto compress after save.
If Celery are installed on Site Packages. You just need create one post_save on
your model to use async compress.


```python
# listeners.py file
Expand All @@ -104,6 +104,18 @@ post_save.connect(auto_compress_file_on_post_save, sender=MyContent)

```

If you don´t wanna use Celery async compress:


```python

def auto_compress_file_on_post_save(sender, instance, **kargs):
instance.upload_file.compress(async=False)

post_save.connect(auto_compress_file_on_post_save, sender=MyContent)

```


Developer
---------
Expand Down

0 comments on commit 4c11165

Please sign in to comment.