Chive / django-multiupload

Dead simple drop-in multi file upload field for Django forms using HTML5's multiple attribute.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attachment() in Usage example, where does it come from?

rdvonz opened this issue · comments

Can't figure it out. An explanation may help others!

Having the same error here: global name 'Attachment' is not defined

Attachment is author's model and it's not part of this lib. It's probably something simple:

class Attachment(models.Model):
    parent = models.ForeignKey('Letter')
    file = models.FileField(upload_to='attachments/')

And it's not valid example though, because only ModelForm's instances have instance attribute, but not Form's.

Hello guys, sorry for the late response. I'm currently deployed for my military service and have no access to a computer. I'll make sure to improve the example as soon as I get home though (little more than one month from now)! Cheers

A working example is greatly appreciated.

Hey @rdvonz @bahiamartins @AlefGarden @tuldok89. I've added two examples here https://github.com/Chive/django-multiupload/tree/master/examples. Please let me know if you have any other questions.

Thanks. I was able to figure it out a few days ago. But still the examples are be helpful for other users. Good stuff.