Re: [web2py] Re: How to disable modifying Email in auth.profile()

2013-06-06 Thread
Thanks for sharing!

Lio


On Thu, Jun 6, 2013 at 10:49 PM, Rob_McC  wrote:

> Lio:
>
> Not sure if this would be helpful, it was for my app. It seems to work so
> far.
>
> *This allows users to login with
> *
> - email
> OR
> - username
>
> I have a message reminding them they can login with either.
>
> I don't allow changing username, but allow changing email.
>
> I also will remove the Forgot your username, cause they can login with
> email.
>
> Good luck
> R
> File:
> *controllers/default.py*
>
>
> Reference:
>  http://www.web2pyslices.com/slice/show/1642/login-with-username-and-email
>
>
>
> def user():
>
> if 'login' in request.args:
> db.auth_user.username.label = T("Username or Email")
> auth.settings.login_userfield = 'username'
> if request.vars.username and not IS_EMAIL()(request.vars.username
> )[1]:
> auth.settings.login_userfield = 'email'
> request.vars.email = request.vars.username
> request.post_vars.email = request.vars.email
> request.vars.username = None
> request.post_vars.username = None
>
> return dict(form=auth())
>
> return dict(form=auth())
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/r_2nobzCGyc/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to disable modifying Email in auth.profile()

2013-06-06 Thread
For the first issue of inputting wrong email, this can be solved by email
verification.
For the second concern I agree if the user's email become invalid they will
not be able to receive message to this address but they still have his
account with the site. Since email will be used as the only identification
here, I'm not very confident after changing it couple of times the user
won't mess up his memory on the latest email for login.. Anyway, it's still
a good point to give some consideration to. Thank you Anthony.


On Thu, Jun 6, 2013 at 8:20 PM, Anthony  wrote:

> Hmm, I don't think I've seen a site that doesn't let you modify your email
> address. What if the user makes an error when registering or subsequently
> changes their email address -- they then have to abandon their account and
> sign up for a new one?
>
>
> On Thursday, June 6, 2013 3:24:44 AM UTC-4, Lio wrote:
>>
>> Hello guys,
>>
>> In my app I use email as login user name, but I found in
>> app/default/user/profile the email can be modified. This seems to be a risk
>> either the user may lose his account by accidentally change email or hacked
>> by others in some way. The solution I can think of is customize the profile
>> page and hide email field. Is there better practice which show the email
>> but forbid modifying it like the id field of most tables.
>>
>> regards,
>> Lio
>>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/r_2nobzCGyc/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How to disable modifying Email in auth.profile()

2013-06-06 Thread
Thanks Martin, it's a easy solution.
On Jun 6, 2013 3:38 PM, "Marin Pranjić"  wrote:

> With this line you will disable edit of email field:
> db.auth_user.email.writable = False
>
> Email will still be printed in form but read only.
>
> You can remove it completely from form by adding:
>
> db.auth_user.email.readable = False
>
> You should put this lines conditionally, for example in default.py user
> function:
>
> if request.args(0) == 'profile':
> ... 
>
> Else you'll end up disabling email field even in registration page.
>
> Marin
>
>
> On Thu, Jun 6, 2013 at 9:24 AM, Lio  wrote:
>
>> Hello guys,
>>
>> In my app I use email as login user name, but I found in
>> app/default/user/profile the email can be modified. This seems to be a risk
>> either the user may lose his account by accidentally change email or hacked
>> by others in some way. The solution I can think of is customize the profile
>> page and hide email field. Is there better practice which show the email
>> but forbid modifying it like the id field of most tables.
>>
>> regards,
>> Lio
>>
>> --
>>
>> ---
>> 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 web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/r_2nobzCGyc/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Problem overriding bootstrap.min.css with customized submit button style

2013-06-03 Thread
It works nicely now. Thank you Paolo.


On Tue, Jun 4, 2013 at 4:32 AM, Paolo Caruccio
wrote:

> please try:
>
> input.btn_auth {
>
>  background:url('../images/**button_02.png') no-repeat;
>  border: 0px;
>  width:205px;
>  height:45px;
>  position: relative;
>  top:80px;
>  left:97px;
> }
>
> input.btn_auth:hover {
>  background:url('../images/**button_hover_02.png')
> }
>
> input.btn_auth:active {
>
>  background:url('../images/**button_active.png') no-repeat;
>  width:201px;
>  height:41px;
> }
>
>
> Il giorno lunedì 3 giugno 2013 19:05:02 UTC+2, Lio ha scritto:
>
>> Hello there,
>>
>> I'm trying to use a customized submit button for login. The problem is in
>> normal status the button image is the correct one but width is controlled
>> by bootstrap.min.css; in hover status the width is correct but image is
>> overridden by bootstrap.min.css Driving me crazy...
>>
>> Code in view:
>>   {{form.custom.submit['_class']**='btn_auth'}}
>>   {{=form.custom.submit}}
>>
>>
>> Code in customized css file:
>> .btn_auth {
>>  background:url('../images/**button_02.png') no-repeat;
>>  border: 0px;
>>  width:205px;
>>  height:45px;
>>  position: relative;
>>  top:80px;
>>  left:97px;
>> }
>> .btn_auth:hover{
>> background:url('../images/**button_hover_02.png');
>> border: 0px;
>>  width:205px;
>>  height:45px;
>>  position: relative;
>>  top:80px;
>>  left:97px;
>> }
>>
>>
>> .btn_auth:active{
>> background:url('../images/**button_active.png') no-repeat;
>> border: 0px;
>>  width:201px;
>>  height:41px;
>>  position: relative;
>>  top:80px;
>>  left:97px;
>> }
>>
>> Can someone please advise? Thanks in advance.
>>
>> Lio
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/3XQzzZwZ8vk/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to store data records for recurrent jQuery call

2013-05-23 Thread
Thank you Calvin and Alan. I'm not familiar with JSON and not much content
in the book at the moment. I will do my research based on your suggestions.

Regards,
Lio


On Wed, May 22, 2013 at 1:09 AM, Alan Etkin  wrote:

> You could then write some javascript to populate block 2 using the rec
>> object created...
>>
>
> I think this alternative should do what you want too:
>
> (in a view)
>
> {{=SCRIPT("""
> var myRows = %(rows)s;
> """ % dict(rows=.select().as_json()))}}
>
>
> Then you can access the record values in myRows[n].fieldname from the
> jQuery event handlers.
>
>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/9qu4EI8iOWY/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: “Exceeded soft private memory limit” when upload (1.56M) on GAE

2013-04-18 Thread
Hello Christian,

Thank you very much for explaining. The reason is clear to me now. I will
try to work around it.

Regards,
Lio


On Thu, Apr 18, 2013 at 11:23 PM, Christian Foster Howes
wrote:

> Lio,
>
> there are potentially 2 problems here:
>  - the request thread is using too much memory/has a memory lead
>  - the size of the file is too large.
>
> i know you are having the second problem, not sure about the first.  it's
> possible that the second problem is being reported to you with a
> mis-leading message.
>
> as for the file size, i am assuming that you are trying to store the file
> directly on a row in the table.  Remember that on GAE, when using the
> datastore, each row is limited to 1MB total, and any given field is limited
> to 1MB (which you can only achieve if the row contains 1 field).
>
> To grow past this limitation, look into the GAE blobstore for storing
> large files.  you also can write tools that upload the file to some other
> location (google cloud storage, amazon S3) and store the link to the file
> in your table.
>
> hope that helps!
>
> cfh
>
>
> On Tuesday, April 16, 2013 7:25:16 PM UTC-7, Lio wrote:
>>
>> Hello,
>>
>> Today the first time I got 500 Server Error when trying to upload a file
>> of 1.56MB as a field of a record in a table. When checking GAE logs it
>> shows "*Exceeded soft private memory limit with 20x.xxx MB after
>> servicing XXX requests total*" every time I tried to upload the same
>> file.
>>
>> I've done the same operation several time without any problem, I guess
>> it's very likely caused by the file size, so I reduced the file size to
>> less than 600K then the uploading succeeded.
>>
>> My question is what is the limit of upload file size and also in case I
>> really need to upload a big file what could be the solution?
>>
>> Thanks for advice.
>>
>>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/NTtV2sOI6Ss/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Fail to add entry to list:reference field

2013-04-07 Thread
Hi Anthony,

I compared the layout.html against older version, the jQuery issue was
resulted because I manually add:
 (I
thought jQuery was not included in Layout.html) Removing this line solved
the problem. Also I will try to build a custom widget.
Thank a lot.

Spring


On Mon, Apr 8, 2013 at 1:09 AM, Anthony  wrote:

> The intention is to create a list of items each of which are selected from
>> the dropdown of referenced table, similar to 'list:string' with a "+/-"
>> sign at the end to add another item. When click the "+/-" sign it pops
>> another dropdown list to add new item. I photoshoped the pic below to show
>> what I want:
>
>
>> [image: Inline image 2]
>>
> If that's what you want, you'll have to create a custom 
> widget-- web2py 
> doesn't have a built-in widget that works like that.
>
>
>>
>> By checking database records I realized that all "list" fields even in
>> other tables cannot be modify by length any more. Below is a pic of db
>> management in Appadmin. No "+/-" sign. Don't know what went wrong..
>> [image: Inline image 1]
>>
>> Hmm, can you confirm that jQuery is loaded on that page (the list widget
> requires jQuery)?
>
> Anthony
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/zZ7LHTCcUUA/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Fail to add entry to list:reference field

2013-04-07 Thread
The intention is to create a list of items each of which are selected from
the dropdown of referenced table, similar to 'list:string' with a "+/-"
sign at the end to add another item. When click the "+/-" sign it pops
another dropdown list to add new item. I photoshoped the pic below to show
what I want:

[image: Inline image 2]


By checking database records I realized that all "list" fields even in
other tables cannot be modify by length any more. Below is a pic of db
management in Appadmin. No "+/-" sign. Don't know what went wrong..
[image: Inline image 1]

Hope I explain clearly. Thanks for you time.




On Sun, Apr 7, 2013 at 10:50 PM, Anthony  wrote:

>
>> I read in the book that "requires' will be set by default for
>> "list:reference". I tried this, and the output is the same as with  
>> IS_IN_DB(...,
>> multiple=True), which is a multiple item box listing all options as
>> shown in the pic below:
>> [image: Inline image 1]
>>
>
> The above looks correct. What were you expecting?
>
> Anthony
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/zZ7LHTCcUUA/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


<<4.png>><<3.png>>

Re: [web2py] Re: Fail to add entry to list:reference field

2013-04-07 Thread
Hi Anthony,

I read in the book that "requires' will be set by default for
"list:reference". I tried this, and the output is the same as with
IS_IN_DB(...,
multiple=True), which is a multiple item box listing all options as shown
in the pic below:
[image: Inline image 1]
And I still don't understand why the value of the field is '1L' instead of
'1' as in t_contacts.id..

Regards,
Spring


On Sun, Apr 7, 2013 at 8:42 PM, Anthony  wrote:

> Field('f_keypersons', type='list:reference t_contacts', requires=
>> IS_IN_DB(db, 't_contacts.id', '%(f_name)s'),
>
>
> For list:reference fields, it should be IS_IN_DB(..., multiple=True).
> Actually, you shouldn't need to set the "requires" attribute explicitly
> anyway because you will get IS_IN_DB(..., multiple=True) as the default
> validator for a list:reference field.
>
> Anthony
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/zZ7LHTCcUUA/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


<<2.png>>

Re: [web2py] [FYI] Pyodel is now a plugin

2013-03-29 Thread
Hi Alan,

It's true I'm using auth.wiki() in my app. Is there any work around for the
time being?
On Mar 30, 2013 12:02 AM, "Alan Etkin"  wrote:

> This is very odd, I belive it is a bug in the app authentication
>>> configuration itself, since I cannot reproduce the  behavior in another GAE
>>> app which also relies in auth for access control. In case I find a way
>>> around this I'll post it here: http://code.google.com/p/**
>>> pyodel/issues/detail?id=1
>>
>>
> I think I found the cause of the funny GAE login redirection loop: It
> occurs in any app which uses the auth.wiki feature. This doesn't happen
> without auth.wiki(...) in the model or controller, even if the app uses
> auth for authentication.
>
> I only tested this with the last python sdk and two different apps, but
> probably will be the same for any app in production using the web2py 2.4 or
> better, so I guess this should be submitted as a web2py issue.
>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/acd1SylusMo/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.