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?
--
--
How can i make it so that when a user uploads an image, it automatically
gets resized to a specified dimension?
Thanks!
--
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
...@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
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
What's the correct way of deleting a user?
Say someone creates an account on my page and wants to remove him/herself.
How can I do this?
Thank you!
--
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
On Tuesday, December 18, 2012 8:17:11 AM UTC-8, Daniele wrote:
The newest version of web2py has added some + and - clickable links to form
elements so that it is possible to remove the element. However, if there is
only one element and one clicks the -, the form disappears and there's
The newest version of web2py has added some + and - clickable links to form
elements so that it is possible to remove the element. However, if there is
only one element and one clicks the -, the form disappears and there's no
way to get the form element back without refreshing the page.
I'll
. ;-)
On Saturday, 15 December 2012 11:35:28 UTC-6, Daniele wrote:
I want to do something very simple but it's taking me eons to do this~
When the button is clicked, I want a javascript alert to pop up that
asks, are you sure? Yes/No.
If Yes, then run this code: auth.del_membership('role
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
()
...
and the response flash will be injected in the proper place.
On Tuesday, 18 December 2012 10:49:28 UTC-6, Daniele wrote:
Still isn't working for me :'(
In my view, I have:
div id=deltutor{{=A('Delete Role',_class=btn
btn-danger,_id='deltutorlink',
callback=URL('edit_profile
It's quite pathetic that web2py doesn't provide a BUTTON helper by the
way...
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form}} in my view.
However, if I'm making a custom form
understand why the form is being submitted via other buttons as
well. Does anyone know why this is???
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form}} in my view.
However, if I'm
Please pardon my ignorance, I didn't know there was a button helper.
And thanks Massimo, I'll give the A with the class btn a try now!
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display
I am trying with:
{{=A('Delete Role', _class=btn btn-danger, _id=del_role_tutor,
callback=URL('test'), target=:eval)}}
and in my controller:
def test():
return Hello
or
def test():
return dict()
but nothing happens. Why is this??
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele
exactly how your code looks like.
On Saturday, 15 December 2012 09:08:37 UTC-6, Daniele wrote:
I am trying with:
{{=A('Delete Role', _class=btn btn-danger, _id=del_role_tutor,
callback=URL('test'), target=:eval)}}
and in my controller:
def test():
return Hello
or
def test
-6, Daniele wrote:
Ok. What's the correct way of associating an action to the HTML button
with web2py?
On Tuesday, December 11, 2012 12:30:34 AM UTC, Massimo Di Pierro wrote:
This is not worth it. If you make a custom form than you are using html,
you may as well make the button in html
I'm also trying this but it doesn't work:
button onclick={{auth.del_membership('role'))}} class=btn
btn-dangerDelete Role/button
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form
So it's not possible to do this with a button?
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form}} in my view.
However, if I'm making a custom form using form.custom, how can I
December 2012 15:15:30 UTC-6, Daniele wrote:
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form}} in my view.
However, if I'm making a custom form using form.custom, how can I display
that button??
Thanks
--
When I use form.add_button() I am able to add a button to a form, which I
can display with {{=form}} in my view.
However, if I'm making a custom form using form.custom, how can I display
that button??
Thanks
--
Hello guys, I'm trying to add a button to a form and when clicked, I'd like
for an action to be called that erases a record from the db.
I saw the butting addition can be done with form.add_button('Delete
Record', URL('other_page'))
However, I am wondering how I can tie in an action instead of
images to display. I really am having a hard time
figuring out how this works... -_- sorry guys
On Wednesday, December 5, 2012 2:06:57 PM UTC, Daniele wrote:
Guys I know this sounds simple but I'm having a hard time displaying
uploaded images. I have an upload field in my model where logged
WOHO!!! I GOT IT!!!
I needed to put URL('download', args=images[0])
I was spending time trying to figure out what the heck that
request.args[-1]thing was. Is that even necessary?
On Wednesday, December 5, 2012 2:06:57 PM UTC, Daniele wrote:
Guys I know this sounds simple but I'm
the image. I don't know why I can't do
something so simple -_-
Any help is greatly appreciated.
Daniele
On Wednesday, December 5, 2012 2:06:57 PM UTC, Daniele wrote:
Guys I know this sounds simple but I'm having a hard time displaying
uploaded images. I have an upload field in my model
I want to tick a checkbox if a user has membership to something, else leave
unticked.
I tried putting it in the Field's default variable as such,
Field('is_tutor', 'boolean', default=auth.has_membership(auth.user_id,
'Tutors')) but this is causing an error. What's the correct way to do this?
I am unable to update entries in my database. I think I have an idea of why
this may be, but I'm not sure how to go about fixing this.
In my controller, I have:
tform = SQLFORM.factory(
Field('is_tutor', 'boolean'),
*[f for f in db.tutor if f.name.startswith('t_')],
, 2012 5:54:58 PM UTC-5, Daniele wrote:
I am unable to update entries in my database. I think I have an idea of
why this may be, but I'm not sure how to go about fixing this.
In my controller, I have:
tform = SQLFORM.factory(
Field('is_tutor', 'boolean'),
*[f for f
the
table now so, thanks for the help ;)
On Friday, December 7, 2012 11:38:52 PM UTC, Daniele wrote:
Ok that seems to have done the trick. However, it's creating a new record
every time which means that the logged in user does not refer to the tutor
table. Does the id field have
Worked!!! Thanks s much this has been bugging me for a while.
On Saturday, December 8, 2012 12:15:49 AM UTC, Anthony wrote:
db.define_table('tutor',
Field('user', 'reference auth.user.id'),
...)
This is not correct. It should be 'reference [table name]', so in this
case,
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
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
of the relevant model and controller code.
Anthony
On Thursday, December 6, 2012 8:33:10 AM UTC-5, Daniele wrote:
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
.
Anthony
On Thursday, December 6, 2012 8:51:02 AM UTC-5, Daniele wrote:
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
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
On Thursday, December 6, 2012 10:05:43 AM UTC-5, Daniele wrote:
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 abas...@gmail.com wrote:
You are using
Guys I know this sounds simple but I'm having a hard time displaying
uploaded images. I have an upload field in my model where logged in users
can upload an image. But in my views when I try to do
{{=IMG(_src=URL('uploads/', row.image))}} where row is a variable that
refers to
UTC-5, Daniele wrote:
Guys I know this sounds simple but I'm having a hard time displaying
uploaded images. I have an upload field in my model where logged in users
can upload an image. But in my views when I try to do
{{=IMG(_src=URL('uploads/', row.image))}} where row is a variable
/.
{{=URL('default', 'download', args=row.image)}} is just the portion to put
into the img tag as the src's attribute value
{{=IMG(
_src=URL('default', 'download', args=row.image)
)
}}
is the right one!
On Wednesday, December 5, 2012 6:36:10 PM UTC+1, Daniele wrote:
I have def
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
', 'upload',
uploadfolder=os.path.join(request.folder,'uploads/profiles/')
Should I just change the view to read URL('uploads/profiles/', 'download',
args=row.image) or would that be an inelegant solution?
On Wednesday, December 5, 2012 2:06:57 PM UTC, Daniele wrote:
Guys I know this sounds simple
with e.g. SQLFORM.factory because generally your form.vars
would be ready to be inserted into the table if the form has the same
structure of the table itself, e.g. db.table.insert(**form.vars))
On Monday, December 3, 2012 3:27:29 PM UTC+1, Daniele wrote:
Hey guys, I'm wondering if there's a way
need this stored next to the auth_user table the recommended way is
extending auth_user with auth.settings.extra_fields
On Tuesday, December 4, 2012 5:21:59 PM UTC+1, Daniele wrote:
OK. So I removed what I had before (tables in a database) and moved to
SQLFORM.factory. I now have this in my
have to specify that it only needs to delete these for the
logged in user. How can I do this? Also, is deleting the correct thing to
do or should I just reset the values to a default, like or None ?
Thanks
On Monday, December 3, 2012 2:27:29 PM UTC, Daniele wrote:
Hey guys, I'm wondering
And the same goes for db.auth_user.insert() ... does it imply the logged
user or not?
On Monday, December 3, 2012 2:27:29 PM UTC, Daniele wrote:
Hey guys, I'm wondering if there's a way from the controller to know
whether a form's boolean field (checkbox) is selected or not. I only want
are updated/created with the correct values.
On Tuesday, December 4, 2012 8:34:31 PM UTC+1, Daniele wrote:
And the same goes for db.auth_user.insert() ... does it imply the logged
user or not?
On Monday, December 3, 2012 2:27:29 PM UTC, Daniele wrote:
Hey guys, I'm wondering if there's a way from
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
Hey guys, I'm wondering if there's a way from the controller to know
whether a form's boolean field (checkbox) is selected or not. I only want
to add the info in the form to the database if the checkbox is selected,
otherwise the controller should not process that form.
Thanks!
--
using a completely custom form or were you
able to manipulate the SQLFORM inside the controller?
On Saturday, December 1, 2012 7:03:33 AM UTC-6, Daniele wrote:
I ended up putting them in separate divs and hiding the entire div. Works
like a charm!
Thanks guys
On Thursday, November 29, 2012
, but only as a last resort.
Best wishes for your app, D
On Saturday, 1 December 2012 13:13:13 UTC, Daniele wrote:
Hmmm that's one option, but here's the problem.
Basically, I want users to sign up very easily. So I'm just using
web2py's default auth for that.
Then, I'd like them to pick
(group_id, user_id)
Am I on the money or is this incorrect?
Thanks guys :D
On Sunday, December 2, 2012 1:27:26 PM UTC, Daniele wrote:
OK I think that's probably the easiest solution for now.
How can I do this? Do I need to add
auth.add_group('role', 'description')
in my db.py file
response.flash = 'record inserted'
On Sunday, December 2, 2012 9:35:38 PM UTC+8, Daniele wrote:
Alright I've created the two groups with the web2py appadmin interface. Now
I suppose the rest of the logic goes in the controller.
I have a SQLFORM right now but it probably makes more
, November 29, 2012 11:07:46 AM UTC-5, Daniele wrote:
I could do that. Would I need to add the div directly in the controller
or the view? My controller looks something like this now:
def mypage():
form = SQLFORM(db.mytable)
return dict(form=form)
I guess there should be a way to edit
participate in more than
one group. It's easy to test for group membership -- just use the
decorator:
@auth.requires_membership('tutor')
-- Joe B.
On Tuesday, November 20, 2012 5:57:57 PM UTC-8, Daniele wrote:
I am trying to build a model where each logged user can decide if he/she
is a tutor
Hmm, that gets rid of the input boxes but not of the fieldnames as well. I
guess I'll have to do it manually for each field.
On Thursday, November 29, 2012 9:40:29 AM UTC, Niphlod wrote:
$(:input) ?
On Thursday, November 29, 2012 2:29:46 AM UTC+1, Daniele wrote:
Hello all :)
I have
On Thursday, November 29, 2012 3:50:25 PM UTC, Anthony wrote:
Maybe you could put all the fields inside a div and then hide/show the
whole div.
Anthony
On Thursday, November 29, 2012 7:45:22 AM UTC-5, Daniele wrote:
Hmm, that gets rid of the input boxes but not of the fieldnames as well.
I guess
I'd also like to change that error message value already in database or
empty as I find it a pointless message.
But I tried with db.auth_user.email.requires[0].error_message = T(The
email you have entered has already been registered.)
and it doesn't seem to change anything. Am I misplacing this?
Thanks, that did the trick!
On Thursday, November 29, 2012 12:30:31 AM UTC, Mark Li wrote:
db.auth_user.email.requires[1].error_message = T(The email you have
entered has already been registered.)
Try using the index of 1, not 0.
On Wednesday, November 28, 2012 4:55:54 PM UTC, Daniele
I really believe web2py will indeed become the rails for python as
someone mentioned. Actually, I believe it's much better, easier to use and
comprehend, and more pleasant to develop in.
That said, I agree web2py needs to reach a critical mass of users because
as of now, it's too hard to get
Hello all :)
I have a db.define_table that defines a particular role and all its fields.
One of the fields is a boolean, which will display as a checkbox in the
SQLFORM.
What I'd like to do is hide ALL the elements in the SQLFORM if the
radiobutton is unchecked, and show all the elements if
:
Does the dashboard page require login? If so, that's why it is redirecting
to the login page. If you want the user to be logged in automatically after
registration, you can do:
auth.settings.login_after_registration = True
Anthony
On Friday, November 23, 2012 8:34:01 AM UTC-5, Daniele wrote
I still cannot get this to work. Any tips?
On Sunday, November 18, 2012 10:51:14 PM UTC, Daniele wrote:
Hey guys, I would like to set register_next to move on to a URL upon
successful registration. However, it seems to be redirecting me to the
login page right now. I believe this is because
Hello all,
I'm wondering why I cannot get the email upon registration to work. I've
finally gotten basic emailing to work, but it doesn't seem to send anything
automatically upon user registration.
Here's my db.py file:
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth
'
Do you have similar code?
On Friday, 23 November 2012 09:26:57 UTC-6, Daniele wrote:
Hello all,
I'm wondering why I cannot get the email upon registration to work. I've
finally gotten basic emailing to work, but it doesn't seem to send anything
automatically upon user registration.
Here's
Yeah I log into the account every day so there's no problem there.
I am trying to set the setting mail.settings.server = 'logging' but I do
not know where it logs the messages...does anyone know where I'd find them?
On Wednesday, November 21, 2012 7:32:26 PM UTC, Daniele wrote:
I'm trying
Still doesn't work. I'm starting to wonder if this isn't a problem with the
fact that I have a custom signup page?
On Wednesday, November 21, 2012 7:32:26 PM UTC, Daniele wrote:
I'm trying to send emails upon user registration. This is what I have in
my models file:
mail
PM UTC, Daniele wrote:
I'm trying to send emails upon user registration. This is what I have in
my models file:
mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'em...@gmail.com' #There's a proper email here
mail.settings.login
decision to have mail.settings in the db.py file, then
at the bottom have them reference another variable in a file called
0.pyseriously??
On Wednesday, November 21, 2012 7:32:26 PM UTC, Daniele wrote:
I'm trying to send emails upon user registration. This is what I have in
my models
...
On Wednesday, November 21, 2012 12:22:46 AM UTC, Daniele wrote:
For some reason, I am not getting the right error messages to display on
my login form.
Right now, I'm getting the same errors that one should get upon
registration, such as:
Minimum length is 8
Must include at least 1 upper case
I'm trying to send emails upon user registration. This is what I have in my
models file:
mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'em...@gmail.com' #There's a proper email here
mail.settings.login = 'username:password' #There's a proper
I just tried port 25 as recommended on google's FAQ
(http://support.google.com/mail/bin/answer.py?hl=enanswer=78775)
Still nothing. I'm wondering how can I debug this? Is there a log file of
what's happening behind the scenes here?
On Wednesday, November 21, 2012 7:32:26 PM UTC, Daniele wrote
Thanks that seems to have worked. This was totally undocumented (or if it
was, it was in an obscure place because I looked quite hard for how to do
this.) What does that XML(%s %s % (form.tag, form._xml()[0])) line do
exactly?
Also, say I want to style the button now...how can I do that?
On
For some reason, I am not getting the right error messages to display on my
login form.
Right now, I'm getting the same errors that one should get upon
registration, such as:
Minimum length is 8
Must include at least 1 upper case
Must include at least 1 number
However, this is giving away too
I am trying to build a model where each logged user can decide if he/she is
a tutor or student or both.
So the tutor table has to 'reference auth.settings.table_user_name' and
student also has to have the same reference.
The tutor/student/logged user have to be related by their id key I
, readable=False)
to make it automatic.
On Friday, 16 November 2012 15:44:17 UTC-6, Daniele wrote:
Guys I'm wondering when I get someone to register, I'd like to have a
field in my database for the datetime.
In my db.py file, I have a Field('registration_time', 'datetime')
However, how do I pass
## configure auth
policy lines
auth.settings.register_next = URL('user/profile')
Peter
On Sunday, 18 November 2012 22:51:14 UTC, Daniele wrote:
Hey guys, I would like to set register_next to move on to a URL upon
successful registration. However, it seems to be redirecting me
, November 18, 2012 10:51:14 PM UTC, Daniele wrote:
Hey guys, I would like to set register_next to move on to a URL upon
successful registration. However, it seems to be redirecting me to the
login page right now. I believe this is because I have
@auth.requires_login()
def mypage
You're going to have to change the style via CSS. If it's an inbuilt form
in web2py like the login one, good luck :P you will have to use the custom
form widgets and do a bunch of somersaults. Try following this guide, it
may help:
http://web2py.com/book/default/chapter/07#FORM
On Wednesday,
Ah ok I just took a look at the HTML and saw that my code conflicts with
what web2py is generating.
Basically there's a form within a form being constructed, so it looks like
this:
form class=form-horizontalform action=
enctype=multipart/form-data method=post
To avoid this, how can I
Hey guys, I would like to set register_next to move on to a URL upon
successful registration. However, it seems to be redirecting me to the
login page right now. I believe this is because I have
@auth.requires_login()
def mypage:
in the controller. How can I make it so that when a user
I have a field in my register form for verifying the password, as such:
Field http://127.0.0.1:8000/examples/global/vars/Field('password',
'password', length=512, readable=False),
Field http://127.0.0.1:8000/examples/global/vars/Field('password_verify',
'password', length=512,
I'm having a similar problem. I am making a custom form with this code in
the view:
{{=form.custom.begin}}
div class=control-group {{if form.errors['email']:}}error{{pass}}
label class=control-label for=inputEmailEmail address/label
div class=controls
Guys I'm wondering when I get someone to register, I'd like to have a field
in my database for the datetime.
In my db.py file, I have a Field('registration_time', 'datetime')
However, how do I pass in that the time (now) is supposed to be taken when
the user submits the form?? I'm a bit
I cannot get response.flash to display for the life of me...I'm using a
vanilla version of the latest twitter bootstrap and have the following in
my style.css (which I took verbatim from web2py's css file)
div.flash {
font-weight:bold;
display:none;
position:fixed;
padding:10px;
Bump! I'd also like to see a guide on how to do this.
On Friday, January 21, 2011 9:18:12 PM UTC, stargate wrote:
I as wondering if there is step-by step instructions installing web2py
on a CentOS version 4.x server with cPanel installed.
--
, November 12, 2012 4:52:53 PM UTC, Daniele wrote:
Once I have the class, how can I get the jQuery entropy check for password
strength to change the background color? Again, this is on a custom form so
I'm having quite some trouble with this...
On Monday, November 12, 2012 3:51:48 PM UTC, Massimo Di
I am writing a custom registration form. I noticed that in the controller,
if I put
def signup():
return dict(form=auth.register())
I get a Retype password field. However, if I put
def signup():
form = SQLFORM(auth.settings.table_user,
labels = {'email':'Email address'},
').add_class('test')
On Sunday, 11 November 2012 21:03:04 UTC-6, Daniele wrote:
I am writing a custom registration form. I noticed that in the
controller, if I put
def signup():
return dict(form=auth.register())
I get a Retype password field. However, if I put
def signup():
form
I just started using web2py and am having lots of trouble with things that
I think should be quite simple. I will enumerate them here in the hopes
they can be answered:
1) I had made a design in Twitter bootstrap 2.2.1 which was working fine as
a plain .html file. I saw that web2py used an
90 matches
Mail list logo