Re: [web2py] Re: Resizing a user uploaded image

2013-01-09 Thread Daniele Pestilli
No, just regular web2py webserver on my machine. Jan 9, 2013 2:36 AM、Bruno Rocha rochacbr...@gmail.com のメッセージ: are you running on Google App Engine? -- --

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
I put imageutils in my app's modules directory, then I added: Field(thumbnail, upload, uploadfolder=os.path.join(request.folder, 'uploads', 'profiles', 'thumbs')), to the appropriate database table, and below that, in the same file (db.py) I wrote: from imageutils import THUMB

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
...@gmail.com wrote: Yeah it is a problem in THUMB function, thumb function looks for files under /uploads and you are defining another folder. change the imageutils module replacing /uploads with /uploads/profile On Tue, Jan 8, 2013 at 9:30 PM, Daniele Pestilli byakugan...@gmail.comwrote: I put

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
It seems to be uploading the full-sized image properly but for the thumb it says 'thumbnail': None where thumbnail is the field name in the db.py file. On Wed, Jan 9, 2013 at 1:06 AM, Daniele Pestilli byakugan...@gmail.comwrote: Hmm still not working. I'm wondering if this is the problem

Re: [web2py] Delete a user

2013-01-07 Thread Daniele Pestilli
Well, I know I can do this from the admin interface but I was wondering how a user can remove himself from the website if he so wishes. Should I put the code `db(db.auth_user.email==some...@domain.com).delete()` in a {{=A(_href=action)}} or is that bad practice? I want the user to be able to

Re: [web2py] Re: Add button to form access from view

2012-12-18 Thread Daniele Pestilli
Sure thing Massimo, here's my view: http://bpaste.net/show/nSrzmYsurH2CnXLrpdwJ/ here's my controller: http://bpaste.net/show/KEx38v6ARYgsUwG8oXMd/ Daniele On Tue, Dec 18, 2012 at 5:07 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Please post your code so we can try it. Are you

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
I noticed that I am missing upload=URL('download') in my SQLFORM.factory, so I added that in there but it's still not working. I double checked the image name and you were right, I don't know how I must have mistakenly deleted that part but it was indeed [table_name].[field_name].[rand_string] I

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
of errors now. I never thought uploading and viewing an image could be this complicated. On Thu, Dec 6, 2012 at 1:33 PM, Daniele Pestilli byakugan...@gmail.comwrote: I noticed that I am missing upload=URL('download') in my SQLFORM.factory, so I added that in there but it's still not working. I double

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
Ok here's my code: in db.py from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db) auth.settings.extra_fields['auth_user']= [ # t denote tutor fields, s denote student fields. Field http://127.0.0.1:8000/examples/global/vars/Field('t_image'), Field

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
this just completely broke my website -_- Now I can't even sign a user up anymore because it's requesting all those additional fields. On Thu, Dec 6, 2012 at 2:33 PM, Anthony abasta...@gmail.com wrote: You are using SQLFORM.factory to handle the upload, but the table and field names used

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
maybe instead of adding on to auth, I should just create two separate tables and have them reference auth On Thu, Dec 6, 2012 at 3:05 PM, Daniele Pestilli byakugan...@gmail.comwrote: this just completely broke my website -_- Now I can't even sign a user up anymore because it's requesting

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
Yes I did but, the reason why I hadn't extended those directly in auth_user was precisely because I had noticed that, since some of those fields are required, when a user signs up they are prevented from signing up because those other auth fields have not been input. So what I'll do instead is

Re: [web2py] Re: Displaying an image

2012-12-05 Thread Daniele Pestilli
hmm still not working. I think it's because I set the upload directory to uploads/profiles/ so it's not finding the image. Maybe if I change that setting it will work... On Wed, Dec 5, 2012 at 5:43 PM, Niphlod niph...@gmail.com wrote: ehm in html you need to do img src=/something/photo.png

Re: [web2py] Re: Displaying an image

2012-12-05 Thread Daniele Pestilli
Yeah I checked my controller and it's uploading images to Field('image', 'upload', uploadfolder=os.path.join(request.folder,'uploads/profiles/') Is there a default directory where the download() function wants images to be? On Wed, Dec 5, 2012 at 5:55 PM, Daniele Pestilli byakugan

Re: [web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele Pestilli
How can I blank out all the **form.vars in the event that the form.vars.is_tutor returns false? Is there a simple way to do this or should I manually put in None for all the fields? On Tue, Dec 4, 2012 at 8:16 PM, Niphlod niph...@gmail.com wrote: depends on where do you use that kind of logic.

Re: [web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele Pestilli
input boxes. Am I supposed to somehow put the SQLFORM.factory info in my db.py file? I can't understand why it's doing this... On Wed, Dec 5, 2012 at 12:49 AM, Daniele Pestilli byakugan...@gmail.comwrote: How can I blank out all the **form.vars in the event that the form.vars.is_tutor returns

Re: [web2py] Re: Proper way to reference logged user

2012-12-02 Thread Daniele Pestilli
Hmm I'm still confused. Sorry guys. So the way I'm displaying the two forms is through two tables in the database that I've defined. Consequently, in the controller I have something like form = SQLFORM(db.tutor) Below that I will have something like if form.process().accepted: If not