Here is myapp.model
from django.db import models
from filer.fields.image import FilerImageField
class Item(models.Model):
...
image = FilerImageField()
...
I'd like to hack in the middle of the django-filer uploading process and autocreate instances of Item for every image django-filer receives.
django-filer doesn't have traditional urls.py for me to just override single url pattern pointing to a custom view. How can I approach this?
EDIT:
Thanks to a hint from stefanfoulis, I eventually end up with this code:
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from filer.fields.image import FilerImageField
from filer.models import Image
class Item(models.Model):
...
image = FilerImageField()
...
@receiver(post_save, sender=Image)
def filer_signal(sender, instance, created, **kwargs):
Item.objects.create(
...
image=instance,
...).save()
return