Indeed, you're right - the combination of the two changes solved the problem. I thought that I had tried this previously, but perhaps I had tried one or the other change, without doing both. Thank you!
Still, isn't it possible to pretty much do away with modules without compromising functionality? It seems that Rocha Bruno did this with his Movuca app <https://github.com/rochacbruno/Movuca>, and I thought I was doing something comparable. By the way, I wouldn't have the User_Image class at all, since it's only > defining the table, it serves no purpose > There's a lot more to it in the actual app, which justifies the module. This was just an abstracted example for the purpose of resolving this error issue. Also, the documentation, if I remember correctly, recommends moving all the model stuff to modules to promote efficiency, so I try to go along with that advice. On Monday, October 20, 2014 10:11:33 AM UTC-5, Leonel Câmara wrote: > > Ok you need to fix 2 things in your app, one of them shows I was right > about the table definition problem: > > First, in create_image() change: > > image = IMG(_src = URL('default', 'download', record.user_image), _style > = 'height:200px;width:200px') > > Into this: > > image = IMG(_src = URL('default', 'download', args=record.user_image), > _style = 'height:200px;width:200px') > > > Then, you also need to define the table in your models or in the download > controller, for it to work correctly. One way to do it is to call your > User_Image(db = db, auth_signature = auth.signature) somewhere in your > models or even in your download controller. > > def download(): > from user_custom import User_Image > image_inst = User_Image(db = db, auth_signature = auth.signature) > return response.download(request,db) > > > Doing both these changes solved the problem. > > By the way, I wouldn't have the User_Image class at all, since it's only > defining the table, it serves no purpose, you may as well just define the > table in your models and be done with it (which would result in simpler > code all around). > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-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.

