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 のメッセージ: > are you running on Google App Engine? > -- > > > --

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 wrote: > Hmm still not working. > I'm wondering if this is the prob

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

2013-01-08 Thread Daniele Pestilli
d, Jan 9, 2013 at 12:43 AM, Bruno Rocha 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

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 db.tutor.thumbna

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 del

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

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 just

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 wrote: > this just completely broke my website -_- > Now I can't even sign a user up anymore because it's requ

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 wrote: > You are using SQLFORM.factory to handle the upload, but the table and > field names used there do not matc

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 ('t_image'), Field

Re: [web2py] Re: Displaying an image

2012-12-06 Thread Daniele Pestilli
;) field but it's giving me all sorts 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 wrote: > I noticed that I am missing upload=URL('download') in my SQLFORM.factory, > so I added that

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]"

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, D

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 wrote: > ehm in html you need to do . > {{=URL('default', 'download', args=row.im

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

2012-12-04 Thread Daniele Pestilli
ield <http://127.0.0.1:8000/examples/global/vars/Field>('s_location')] However, when I visit the page I am getting a bunch of 'None' fields without input boxes. Am I supposed to somehow put the SQLFORM.factory info in my db.py file? I can't understand why it's

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 wrote: > depends on where do you use that kind of logic. If the user is a

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 auth.has_