Hey Kenneth, Client wanted a simpler form for adding in new products outside of the backend django admin because the receiving party are not really educated. I'm using django jfu to take files and save them to the model as per the screenshot.
<https://lh3.googleusercontent.com/-14ImdQQwJbo/VXBo7L06g8I/AAAAAAAAALQ/9dpN0nHmfLU/s1600/Screen%2BShot%2B2015-06-04%2Bat%2B11.03.02%2Bpm.png> Could you explain how the system works? On Thursday, June 4, 2015 at 9:54:08 PM UTC+8, Kenneth Bolton wrote: > > Hi Andrew, > > Can you clarify your goals for us? I'm trying to think of a use-case where > one would want ProductImages editable by non-admin users. What you want is > certainly possible, but might end up causing problems with the overall > experience of your users. > > -ken > > On Thu, Jun 4, 2015 at 5:42 AM, Andrew Fam <[email protected] > <javascript:>> wrote: > >> I"m wondering how to create a new product image directly without the >> admin. >> >> Using a package that defines the following >> >> def upload_receive( request ): """ Returns the file(s) uploaded by the >> user. """ return request.FILES['files[]'] if request.FILES else None >> I tried to create a Product image with the following which works in non >> cartridge fields, >> >> f = upload_receive(request) >> instance = ProductImage.objects.create(file=f, product_id=2) >> >> I get *** TypeError: expected string or buffer >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
