Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_on_upload signal not work #73

Open
kartikdanidhariya opened this issue Apr 24, 2015 · 1 comment
Open

create_on_upload signal not work #73

kartikdanidhariya opened this issue Apr 24, 2015 · 1 comment

Comments

@kartikdanidhariya
Copy link

Hi,
i am use your django-ajax-uploader it work properly it uploded image but now i want to save his patyh in models in django for that i am use signal mention in doc

in models.py

class Product_image(TranslatableModel):

translations = TranslatedFields(
    product = models.ForeignKey('Product', verbose_name=_('Product'), null=True, blank=True),
    document = models.FileField(upload_to='attachments/%Y/%m/%d',blank=True, null=True),
)


@receiver(file_uploaded, sender=AjaxFileUploader)
def create_on_upload(sender, backend, request, **kwargs):
    Product_image.objects.create(document=backend.path)

def __str__(self):
    return str(self.product)

image uplod in upload folder properly but path not save in models
how can i get this
Thanks in advance!!!

@derek-adair
Copy link

Not sure this is the best place for support. Regardless, without any errors or more specific code examples or at least an error i'm afraid you wont get much help. The signals work just fine for me using the demo provided.

Does the signal code even get called? if it doesn't get called at all then you are probably linking the signal up improperly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants