Re: [web2py] Re: user request_reset_password doesn't send mail

2018-05-31 Thread Vid Ogris
It sends mail for retrieve username.

On Thu, May 31, 2018, 16:55 Anthony  wrote:

> Is the Auth system otherwise able to send emails successfully?
>
> On Thursday, May 31, 2018 at 7:09:49 AM UTC-4, Yebach wrote:
>>
>> Hello
>>
>> I am using a normal web2py installation and all user features are working
>> (also retrieve username) but the request reset password is not.
>>
>> Any suggestions on what could be the problem
>>
>> My auth.settings are
>>
>> auth.settings.registration_requires_verification = False
>> auth.settings.registration_requires_approval = True
>> auth.settings.reset_password_requires_verification = True
>> auth.settings.remember_me_form=False
>>
>>
>> The redirect does't happen
>>
>> Do I have to write my own request_password function or??
>>
>> Thank You
>>
>> best regards
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/A29561LVYVQ/unsubscribe.
> 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/d/optout.
>

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


[web2py] Re: form fields

2018-05-31 Thread Anthony
On Thursday, May 31, 2018 at 2:27:44 PM UTC-4, Andrea Fae' wrote:
>
> thanks Anthony. Could you give me simple example about second idea? It's 
> noy possible to pass variables to a onvalidation funtion? i.e. onvalidation 
> doesn't accept parameters...the problem is: how to make that object 
> available to the onvalidation function?
>

record = db.mytable(1)

def my_validation(form):
[now access record, which has been defined in the parent scope]

form =SQLFORM(...).process(onvalidation=my_validation)

or:

record = db.mytable(1)

def my_validation(form, record):
...

form = SQLFORM(...).process(onvalidation=lambda form: my_validation(form
, record))

Anthony

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


[web2py] Re: query and json-field

2018-05-31 Thread Anthony
">> db('j->>"x" = 1')._select(db.j.id)
'SELECT "j"."id" FROM "j" WHERE j->>"x" = 1;'

Anthony

On Thursday, May 31, 2018 at 5:01:08 PM UTC-4, mweissen wrote:
>
> Let's say I have a table like
> db.define_table("mytable", Field("j", "json"))
> with some data like db.mytable.insert(j={"x":1})
>
> Now I want to find all records with x==1.
> Of course
> db(db.mytable.j["x"]==1)
> does not work (but it would be fine).
>
> I have tried some queries like
> db.mytable.j.like("%1%")
> db('(j-->x)=1')
>
> but nothing did work. web2py creates always a sql-statement with
>  WHERE X)=1>...
>
> Postgresql does not understand  syntax error at or near "<" Where does this "" come from?
> Any ideas?
>
> Regards, Martin
>
>

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


[web2py] query and json-field

2018-05-31 Thread Martin Weissenboeck
Let's say I have a table like
db.define_table("mytable", Field("j", "json"))
with some data like db.mytable.insert(j={"x":1})

Now I want to find all records with x==1.
Of course
db(db.mytable.j["x"]==1)
does not work (but it would be fine).

I have tried some queries like
db.mytable.j.like("%1%")
db('(j-->x)=1')

but nothing did work. web2py creates always a sql-statement with
 WHERE X)=1>...

Postgresql does not understand " come from?
Any ideas?

Regards, Martin

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


[web2py] Re: form fields

2018-05-31 Thread Andrea Fae'
thanks Anthony. Could you give me simple example about second idea? It's 
noy possible to pass variables to a onvalidation funtion? i.e. onvalidation 
doesn't accept parameters...

Il giorno giovedì 31 maggio 2018 00:24:29 UTC+2, Anthony ha scritto:
>
> SQLFORM shows the values of non-writable fields but does not put those 
> values into HTML form widgets, so they are not submitted with the form. A 
> couple of options:
>
>- Instead of setting writable=False, specify a custom widget for the 
>fields with the HTML readonly attribute set to true (e.g., widget=lambda 
>f, v: SQLFORM.widgets.string.widget(f, v, _readonly=True)). With this 
>approach, be sure to validate the non-writable values as well, as a 
>malicious user can still submit modified values.
>- Create a separate object (e.g., a DAL Row) containing the 
>non-writable field values, and make that object available within the 
>onvalidation function (since those values are not changeable within the 
>form, there is no reason the values must come from the form submission).
>
> Anthony
>
> On Wednesday, May 30, 2018 at 4:28:01 PM UTC-4, Andrea Fae' wrote:
>>
>> Hello I have a SQLFORM but some of them I populate from other variables 
>> and I don't want to change. So I typed field.writable=False...
>> But when I use a custom "onvalidation" function I want to have the 
>> content of all the form fields...
>> In request.vars I see some fields but not all
>> In form.vars I see part of these fields
>> Both without the not writable fields.
>>
>> How is working? request.vars, form.vars. Why do they show different field 
>> values? Why I can't see the not wirtable values? I tried to read the book, 
>> but I didn't find the information yet.
>> Thanks a lot
>>
>

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


[web2py] Re: user request_reset_password doesn't send mail

2018-05-31 Thread Anthony
Is the Auth system otherwise able to send emails successfully?

On Thursday, May 31, 2018 at 7:09:49 AM UTC-4, Yebach wrote:
>
> Hello
>
> I am using a normal web2py installation and all user features are working 
> (also retrieve username) but the request reset password is not.
>
> Any suggestions on what could be the problem
>
> My auth.settings are
>
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval = True
> auth.settings.reset_password_requires_verification = True
> auth.settings.remember_me_form=False
>
>
> The redirect does't happen
>
> Do I have to write my own request_password function or??
>
> Thank You
>
> best regards
>

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


[web2py] Re: json field data sequence

2018-05-31 Thread Anthony
The problem is, on the Python side, the JSON is converted to a plain 
dictionary, and dictionaries do not necessarily preserve the order of keys. 
You can ensure the order of keys is preserved in the stored JSON by passing 
in an OrderedDict rather than a plain dict. However, the DAL will still end 
up converting to a plain dict when you retrieve the JSON from the field. In 
CPython 3.6 and all Python 3.7 implementations, I believe dictionaries are 
supposed to preserve order (though not sure if that applies to json.dumps) 
-- so, if you are working with Python 3, it might behave as desired without 
any workarounds. Otherwise, you will probably have to (a) create a custom 
field type, (b) use a text field type with filter_in and filter_out 
functions to convert to and from JSON, or (c) store the data in a different 
format (e.g., a list of 2-tuples).

For more details, see https://stackoverflow.com/a/23820416/440323.

Anthony

On Thursday, May 31, 2018 at 9:12:05 AM UTC-4, yogeshwar khalkar wrote:
>
> Hi,
>
> I have a JSON field in the table with multiple key-value pairs.
>
> I want to render that data on the screen in the sequence I have entered it.
>
> But web2py rearranges that data in the database, don't know on which 
> precedence.
>
> I want the data in the sequence I have entered in the database.
>
> Anyone know's what happening here and how to keep the sequence of JSON as 
> entered.
>
> Please help me.
>
> Thanks
>
>

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


[web2py] json field data sequence

2018-05-31 Thread yogeshwar khalkar
Hi,

I have a JSON field in the table with multiple key-value pairs.

I want to render that data on the screen in the sequence I have entered it.

But web2py rearranges that data in the database, don't know on which 
precedence.

I want the data in the sequence I have entered in the database.

Anyone know's what happening here and how to keep the sequence of JSON as 
entered.

Please help me.

Thanks

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


[web2py] user request_reset_password doesn't send mail

2018-05-31 Thread Yebach
Hello

I am using a normal web2py installation and all user features are working 
(also retrieve username) but the request reset password is not.

Any suggestions on what could be the problem

My auth.settings are

auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = True
auth.settings.reset_password_requires_verification = True
auth.settings.remember_me_form=False


The redirect does't happen

Do I have to write my own request_password function or??

Thank You

best regards

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