Re: [web2py] Re: DAL MySQL text type

2018-08-20 Thread Anthony
On Monday, August 20, 2018 at 2:41:22 PM UTC-4, Carlos Cesar Caballero 
wrote:
>
> Thanks Anthony, LONGTEXT is exactly what I need. But in case of necessity, 
> how "experimental" is that feature? Should I be worried about unnoticed API 
> changes?.
>

It's not really experimental (been there for years) -- it's just that no 
one ever updated that heading in the book. I just pushed a commit to the 
book repo removing "experimental".

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.


Re: [web2py] Re: DAL MySQL text type

2018-08-20 Thread Carlos Cesar Caballero Díaz
Thanks Anthony, LONGTEXT is exactly what I need. But in case of 
necessity, how "experimental" is that feature? Should I be worried about 
unnoticed API changes?.


Greetings.


El 18/08/18 a las 17:48, Anthony escribió:
The DAL uses LONGTEXT for text fields in MySQL. If you'd like to use 
an alternative, you can create a custom type via 
SQLCustomType: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types-experimental-. 



Anthony

On Saturday, August 18, 2018 at 3:49:35 PM UTC-4, Carlos Cesar 
Caballero wrote:


Hi, Erick, thanks for your answer, there are the DAL types and the
default validators, but there are no mention about the adapters
field types, for example, in MySQL text can be stored in fields of
types TEXT, MEDIUMTEXT or LONGTEXT. I am asking for the type used
in the MySQL DB, and if is possible to set a different one.

Greetings.


El 17/08/18 a las 23:35, Erik escribió:

This section has the types:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types





On Thursday, August 16, 2018 at 9:59:13 AM UTC-7, Carlos Cesar
Caballero wrote:

Hi guys, what kind of data type uses pydal in MySQL for
"text" type?, if
it is TEXT, is possible to set it for using MEDIUMTEXT or
LONGTEXT?


Greetings.


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


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


--
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: custom form web2py not work when i use selectpicker

2018-08-20 Thread Rodrigo Gomes
some one help me pleas

quinta-feira, 16 de Agosto de 2018 às 20:39:35 UTC-3, Rodrigo Gomes 
escreveu:
>
>
> Good evening, folks, I've come here to unveil a mystery, I'm developing an 
> application with web2py, (framework that I use about 3 years ago)
>
> I am using sqlform.factory, passing 2 tables, being that I do this to fill 
> in a single form, table, person and address, for better understanding 
> follows my controller, 
>
>
> @auth.requires_login()
> def students():
> form = form=SQLFORM.factory(db.person, db.address)
>  
> if form.process().accepted:
>id = db.person.insert(**db.person._filter_fields(form.vars))
>form.vars.person=id
>id = db.address.insert(**db.address._filter_fields(form.vars))
>response.flash='Form Submetido com sucesso!' 
>  
> elif form.errors:
>print(form.errors)
> else:
>print('please fill out the form')
>
>
>
>
> if it helps, this is my model, the tables and their relationships, 
>
> db.define_table("person",
> Field("name", "string", length=50),
> Field("cpf", "string", length=11),
> Field("birthday", "date", length=11),
> Field("email","string", length=40),
> Field("registration_date","date", length=40)
> )
>
> db.define_table("cities",
> Field("name", "string"),
> Field("state","reference state")
> )
>
> db.define_table("address_type",
> Field("type","string",length=100),
> )
>
> db.define_table("address",
> Field("number","integer"),
> Field("public_place","string"),
> Field("cep","string",length=15),
> Field("complement","string"),
> Field("cities",'reference cities'),
> Field("address_type",'reference address_type'),
> Field("person",'reference person', writable=False,readable=False)
> )
>
>
>
>
> This is my view 
>
>  method="post">
> 
> 
> 
>  type="text" placeholder="nome">
> 
> 
> 
>  type="text" placeholder="cpf">
> 
> 
> 
> 
>  type="text" placeholder="email">
> 
> 
> 
> 
> 
>  id="no_table_address_type" name="address_type" data-style="btn-info 
> btn-outline-info">
> 
> {{for t in address_type_list:}}
> {{=t.type}}
> {{pass}}
> 
> 
> 
>  data-style="btn-info btn-outline-info" required>
> {{for city in cities_list:}}
> {{=city.name}}
> {{pass}}
> 
> 
> 
> 
> 
> {{=form.hidden_fields()}}
> 
> 
> 
> 
> 
>  data-dismiss="modal">Cancelar
> 
> 
> 
>
>
>
>
> now the problem: this selectpicker, simply my form can not store the value 
> of select, when I add this class, I needed it, I do not need it that much, 
> but it became a mission to understand what's happening here, I gave a print 
> em form. vars.cities and she's just like None, help please
>
>  rodgom...@gmail.com', 'registration_date' public_place ':' ',' '' '' '' 
> '' '' '' '' '' '' 'cities': None, 'address_type': None, 'person': 4}>
>

-- 
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: web2py 2.17.1

2018-08-20 Thread Bob St John
I just downloaded 2.17.1 and it works great... thankyou!

However I am a bit confused with the pyDAL that came with it... _version_ = 
17.11
Same version 17.11 when I downloaded pyDAL using pip
Is this the latest pyDAL 18.08 only without the _version_ number updated?


On Sunday, August 5, 2018 at 6:12:25 PM UTC-7, Massimo Di Pierro wrote:
>
> Hello everybody,
>
> I released pyDAL 18.08 and web2py 2.17.1
> They mostly contain bug fixes as well as better support for python 3 and 
> bootstrap 4 by default.
> Thanks to all those who contributed!
>
> Please check them out and report any issue with them.
>
> I have a been a little slow checking this group because of lots of 
> traveling but I will do my best to catch up. :-)
>
> Massimo
>

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


Re: [web2py] Re: changing %(link)s

2018-08-20 Thread Gualter Portella
Great, Anthony!

You are a legend!

Thanks

2018-08-20 12:55 GMT-03:00 Anthony :

> It also has a "key" key available, so you can do:
>
> auth.messages.reset_password = 'Click on the link
> https://yourdomain.com/user/reset_password?key=%(key)s to reset your
> password'
>
> Anthony
>
> On Monday, August 20, 2018 at 11:12:29 AM UTC-4, Gualter Portella wrote:
>>
>> Thanks, Anthony!
>>
>> And what about the auth.messages.reset_password? It needs the hashcode to
>> redirect to the specfic user, right?
>>
>> Any ideas.
>>
>> Once again thanks,
>>
>> Cheers
>>
>> 2018-08-20 9:36 GMT-03:00 Anthony
>>
>>> Just hard code it:
>>>
>>> auth.messages.verify_email = 'Click on the link
>>> https://yourdomain.com/user/verify_email to verify your email'
>>>
>>> Anthony
>>>
>>>
>>> On Sunday, August 19, 2018 at 10:30:07 PM UTC-4, Gualter Portella wrote:

 Hi,

 Can anybody provide me with specfic directions on how to do the
 following procedure:

 In Auth, by default, email verification is disabled. To enable email,
 append the following lines in the model where auth is defined:

 1
 2
 3
 4
 5

 auth.settings.registration_requires_verification = 
 Trueauth.settings.registration_requires_approval = 
 Falseauth.settings.reset_password_requires_verification = 
 Trueauth.messages.verify_email = 'Click on the link %(link)s to verify 
 your email'auth.messages.reset_password = 'Click on the link %(link)s to 
 reset your password'

 In the two auth.messages above, you may need to replace the URL
 portion of the string with the proper complete URL of the action. This is
 necessary because web2py may be installed behind a proxy, and it cannot
 determine its own public URLs with absolute certainty. The above examples
 (which are the default values) should, however, work in most cases.


 How can I change the %(link)s of lines 4 and 5 above. The app is in
 production, but still pointing to http://127.0.0.1:8000/user/
 verify_email


 many thanks in advance,

>>> --
>>> 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/to
>>> pic/web2py/9zinYUcXA7w/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.
>>>
>>
>>
>>
>> --
>> Gualter Portella
>>
> --
> 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/9zinYUcXA7w/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.
>



-- 
Gualter Portella

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


Re: [web2py] Re: changing %(link)s

2018-08-20 Thread Anthony
It also has a "key" key available, so you can do:

auth.messages.reset_password = 'Click on the link 
https://yourdomain.com/user/reset_password?key=%(key)s to reset your 
password'

Anthony

On Monday, August 20, 2018 at 11:12:29 AM UTC-4, Gualter Portella wrote:
>
> Thanks, Anthony!
>
> And what about the auth.messages.reset_password? It needs the hashcode to 
> redirect to the specfic user, right?
>
> Any ideas.
>
> Once again thanks,
>
> Cheers 
>
> 2018-08-20 9:36 GMT-03:00 Anthony
>
>> Just hard code it:
>>
>> auth.messages.verify_email = 'Click on the link 
>> https://yourdomain.com/user/verify_email to verify your email'
>>
>> Anthony
>>
>>
>> On Sunday, August 19, 2018 at 10:30:07 PM UTC-4, Gualter Portella wrote:
>>>
>>> Hi,
>>>
>>> Can anybody provide me with specfic directions on how to do the 
>>> following procedure:
>>>
>>> In Auth, by default, email verification is disabled. To enable email, 
>>> append the following lines in the model where auth is defined:
>>>
>>> 1
>>> 2
>>> 3
>>> 4
>>> 5
>>>
>>> auth.settings.registration_requires_verification = 
>>> Trueauth.settings.registration_requires_approval = 
>>> Falseauth.settings.reset_password_requires_verification = 
>>> Trueauth.messages.verify_email = 'Click on the link %(link)s to verify your 
>>> email'auth.messages.reset_password = 'Click on the link %(link)s to reset 
>>> your password'
>>>
>>> In the two auth.messages above, you may need to replace the URL portion 
>>> of the string with the proper complete URL of the action. This is necessary 
>>> because web2py may be installed behind a proxy, and it cannot determine its 
>>> own public URLs with absolute certainty. The above examples (which are the 
>>> default values) should, however, work in most cases.
>>>
>>>
>>> How can I change the %(link)s of lines 4 and 5 above. The app is in 
>>> production, but still pointing to http://127.0.0.1:8000/user/
>>> verify_email
>>>
>>>
>>> many thanks in advance,
>>>
>> -- 
>> 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/9zinYUcXA7w/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.
>>
>
>
>
> -- 
> Gualter Portella
>

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


Re: [web2py] Re: access id of newly inserted text

2018-08-20 Thread Lovedie JC
Actually, I just discovered the problem.
I wasn't posting to the correct DIV in html, hence appearing as a blank
message.
I tried to render it into view.html and saw the error.
Now my next challenge is to fix it into the bubble.
See attached.

On Mon, 20 Aug 2018 at 16:51, Anthony  wrote:

> On Monday, August 20, 2018 at 8:47:17 AM UTC-4, Lovedie JC wrote:
>>
>> Message inserted but id is blank
>>
>
> It's not possible for the id to be blank. Are you saying:
>
> id = row.id
>
> throws an exception? How are you determining that "id is blank"?
>
> 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.
>

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


Re: [web2py] Re: changing %(link)s

2018-08-20 Thread Gualter Portella
Thanks, Anthony!

And what about the auth.messages.reset_password? It needs the hashcode to
redirect to the specfic user, right?

Any ideas.

Once again thanks,

Cheers

2018-08-20 9:36 GMT-03:00 Anthony :

> Just hard code it:
>
> auth.messages.verify_email = 'Click on the link
> https://yourdomain.com/user/verify_email to verify your email'
>
> Anthony
>
>
> On Sunday, August 19, 2018 at 10:30:07 PM UTC-4, Gualter Portella wrote:
>>
>> Hi,
>>
>> Can anybody provide me with specfic directions on how to do the following
>> procedure:
>>
>> In Auth, by default, email verification is disabled. To enable email,
>> append the following lines in the model where auth is defined:
>>
>> 1
>> 2
>> 3
>> 4
>> 5
>>
>> auth.settings.registration_requires_verification = 
>> Trueauth.settings.registration_requires_approval = 
>> Falseauth.settings.reset_password_requires_verification = 
>> Trueauth.messages.verify_email = 'Click on the link %(link)s to verify your 
>> email'auth.messages.reset_password = 'Click on the link %(link)s to reset 
>> your password'
>>
>> In the two auth.messages above, you may need to replace the URL portion
>> of the string with the proper complete URL of the action. This is necessary
>> because web2py may be installed behind a proxy, and it cannot determine its
>> own public URLs with absolute certainty. The above examples (which are the
>> default values) should, however, work in most cases.
>>
>>
>> How can I change the %(link)s of lines 4 and 5 above. The app is in
>> production, but still pointing to http://127.0.0.1:8000/user/verify_email
>>
>>
>> many thanks in advance,
>>
> --
> 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/9zinYUcXA7w/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.
>



-- 
Gualter Portella

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


Re: [web2py] Re: access id of newly inserted text

2018-08-20 Thread Anthony
On Monday, August 20, 2018 at 8:47:17 AM UTC-4, Lovedie JC wrote:
>
> Message inserted but id is blank 
>

It's not possible for the id to be blank. Are you saying:

id = row.id

throws an exception? How are you determining that "id is blank"?

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.


Re: [web2py] Re: access id of newly inserted text

2018-08-20 Thread Lovedie JC
Message inserted but id is blank

On Mon, 20 Aug 2018, 15:45 Anthony  wrote:

> Is the problem that you are not getting the id of the latest insert, or
> that you are getting the correct record, but no message is being inserted?
>
> Also, no reason to use if/else in the controller if you are simply going
> to call "pass" in each case. Just call SQLFORM(...).accepts(), or better
> yet, SQLFORM.process().
>
> Anthony
>
> On Monday, August 20, 2018 at 8:27:11 AM UTC-4, lbjc1...@gmail.com wrote:
>>
>> I am using javascript to insert to database and it works well with
>> 
>> jQuery('#myform').submit(function() {
>> ajax('{{=URL('my_search_party')}}',
>> ['message'], 'target');
>> return false;
>> });
>> 
>>
>> Controller code:
>> def my_search_party():
>> form = SQLFORM(db.post)
>> if form.accepts(request, formname=None):
>> pass
>> elif form.errors:
>> pass
>>
>> But when i try to access the recent posted text with this code it does
>> not appear, instead its a blank message
>> row = db(db.post.author== auth.user.id).select(db.post.id, orderby=~db.
>> post.id, limitby=(0,1)).first()
>> id = row.id
>>
>> --
> 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.
>

-- 
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: access id of newly inserted text

2018-08-20 Thread Anthony
Is the problem that you are not getting the id of the latest insert, or 
that you are getting the correct record, but no message is being inserted?

Also, no reason to use if/else in the controller if you are simply going to 
call "pass" in each case. Just call SQLFORM(...).accepts(), or better yet, 
SQLFORM.process().

Anthony

On Monday, August 20, 2018 at 8:27:11 AM UTC-4, lbjc1...@gmail.com wrote:
>
> I am using javascript to insert to database and it works well with 
> 
> jQuery('#myform').submit(function() {
> ajax('{{=URL('my_search_party')}}',
> ['message'], 'target');
> return false;
> });
> 
>
> Controller code:
> def my_search_party():
> form = SQLFORM(db.post)
> if form.accepts(request, formname=None):
> pass
> elif form.errors:
> pass
>
> But when i try to access the recent posted text with this code it does not 
> appear, instead its a blank message
> row = db(db.post.author== auth.user.id).select(db.post.id, orderby=~db.
> post.id, limitby=(0,1)).first()
> id = row.id
>
>

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


Re: [web2py] Re: multiple controllers with one view

2018-08-20 Thread Lovedie JC
Thanks. This is good

On Mon, 20 Aug 2018, 15:16 Anthony  wrote:

> def conversations():
>> row = db(db.post.author== auth.user.id).select(db.post.id, db.post.
>> convo, orderby=~db.post.id, limitby=(0,1)).first()
>> id = row.convo if row else None
>> return dict(id=id)
>>
>>
>> with the view.html
>> {{=conversations()}}
>>
>>
> You must either include "conversations" as a key in the dict returned by
> the controller (so it will be available as a variable in the view), or
> check for the existence of "conversations" in the view before attempting to
> access it:
>
> {{if 'conversations' in globals():}}
> {{=conversations()}}
> {{pass}}
>
> 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.
>

-- 
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: changing %(link)s

2018-08-20 Thread Anthony
Just hard code it:

auth.messages.verify_email = 'Click on the link 
https://yourdomain.com/user/verify_email to verify your email'

Anthony

On Sunday, August 19, 2018 at 10:30:07 PM UTC-4, Gualter Portella wrote:
>
> Hi,
>
> Can anybody provide me with specfic directions on how to do the following 
> procedure:
>
> In Auth, by default, email verification is disabled. To enable email, 
> append the following lines in the model where auth is defined:
>
> 1
> 2
> 3
> 4
> 5
>
> auth.settings.registration_requires_verification = 
> Trueauth.settings.registration_requires_approval = 
> Falseauth.settings.reset_password_requires_verification = 
> Trueauth.messages.verify_email = 'Click on the link %(link)s to verify your 
> email'auth.messages.reset_password = 'Click on the link %(link)s to reset 
> your password'
>
> In the two auth.messages above, you may need to replace the URL portion 
> of the string with the proper complete URL of the action. This is necessary 
> because web2py may be installed behind a proxy, and it cannot determine its 
> own public URLs with absolute certainty. The above examples (which are the 
> default values) should, however, work in most cases.
>
>
> How can I change the %(link)s of lines 4 and 5 above. The app is in 
> production, but still pointing to http://127.0.0.1:8000/user/verify_email
>
>
> many thanks in advance,
>

-- 
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: response.menu links alt attribute and target="blank"

2018-08-20 Thread Anthony
Are you using the default layout.html in the welcome app? If so, it no 
longer uses the MENU() helper, so the solutions you reference do not work. 
Instead, you will have to edit the code in layout.html to do what you want.

Anthony

On Monday, August 20, 2018 at 4:46:22 AM UTC-4, lyn2py wrote:
>
> Hello,
>
> I am using the latest pulled version from GitHub and I am not able to use 
> either of the solution listed by Anthony
>
> Version 2.17.1-stable+timestamp.2018.08.05.17.57.00
>
> Solution 1: 
> ('Label', False, dict(_href=URL(...), _target='blank'))
>
> gave this link: http://
> 127.0.0.1:8000/app/ctrl/index/%7B'_href':%20'/app/ctrl/func
> ',%20'_target':%20'blank'%7D
>
>
> and
>
> Solution 2:
> ('', False, A('Label', _href=URL(...), _target='blank'))
>
> gave this link: http://127.0.0.1:8000/app/ctrl/index/%3Ca%20href= 
>
> But if I used the A(...) code in a controller, it prints to console and 
> screen with correct HTML.
>
> Has there been a change in code? Please assist... Thanks!
>
>
>
>
> On Monday, April 15, 2013 at 9:50:29 AM UTC+8, Anthony wrote:
>>
>> A menu item can be specified like this:
>>
>> ('Label', False, dict(_href=URL(...), _target='blank'))
>>
>> or this:
>>
>> ('', False, A('Label', _href=URL(...), _target='blank'))
>>
>> Note, in the second case, the third element can be any HTML helper object 
>> (including nested helpers).
>>
>> Anthony
>>
>> On Sunday, April 14, 2013 6:09:56 PM UTC-4, BlueShadow wrote:
>>>
>>> Hi,
>>> I like to be able to set some link attributes in my response menu:
>>> I want some links to open in a new tab: target="blank"
>>> and I would love to set some alt atributes for the links in the response 
>>> menu.
>>> Is that even possible?
>>> 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] access id of newly inserted text

2018-08-20 Thread lbjc1978
I am using javascript to insert to database and it works well with 

jQuery('#myform').submit(function() {
ajax('{{=URL('my_search_party')}}',
['message'], 'target');
return false;
});


Controller code:
def my_search_party():
form = SQLFORM(db.post)
if form.accepts(request, formname=None):
pass
elif form.errors:
pass

But when i try to access the recent posted text with this code it does not 
appear, instead its a blank message
row = db(db.post.author== auth.user.id).select(db.post.id, orderby=~db.post.
id, limitby=(0,1)).first()
id = row.id

-- 
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: multiple controllers with one view

2018-08-20 Thread Anthony

>
> def conversations():
> row = db(db.post.author== auth.user.id).select(db.post.id, db.post.
> convo, orderby=~db.post.id, limitby=(0,1)).first()
> id = row.convo if row else None
> return dict(id=id)
>
>
> with the view.html
> {{=conversations()}}
>
>
You must either include "conversations" as a key in the dict returned by 
the controller (so it will be available as a variable in the view), or 
check for the existence of "conversations" in the view before attempting to 
access it:

{{if 'conversations' in globals():}}
{{=conversations()}}
{{pass}}

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] How to stop page load or function if it exceeds a time limit?

2018-08-20 Thread William
I understand web2py discourages the use of multiprocessing. Are there any 
other methods where we can break a function after running for a specific 
time limit? 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] Re: multiple controllers with one view

2018-08-20 Thread lyn2py
To choose which view, put 

response.view="view.html"

in the 2 controllers that share the same view.

And you need to return the same variables used for the view in both 
controllers.




On Monday, August 20, 2018 at 4:44:29 AM UTC+8, lbjc...@gmail.com wrote:
>
> I have two controllers in an app. 
> One controller has functions that manage DAL tables and forms. The second 
> has imported module that are sometimes called. They both use one view. I 
> have tried to figure out ho to work this out but cant find ho to print 
> results to view from the second controller. With this arrangement, I keep 
> getting an error message:  
>
> name 'conversations' is not defined
>
>
> . My second controller has this code:
> def conversations():
> row = db(db.post.author== auth.user.id).select(db.post.id, db.post.
> convo, orderby=~db.post.id, limitby=(0,1)).first()
> id = row.convo if row else None
> return dict(id=id)
>
>
> with the view.html
> {{=conversations()}}
>
> I tried looking for an example, reference previous items related to this 
> and the only answer I got online is this 
> 
>

-- 
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: response.menu links alt attribute and target="blank"

2018-08-20 Thread lyn2py
Hello,

I am using the latest pulled version from GitHub and I am not able to use 
either of the solution listed by Anthony

Version 2.17.1-stable+timestamp.2018.08.05.17.57.00

Solution 1: 
('Label', False, dict(_href=URL(...), _target='blank'))

gave this link: http:
//127.0.0.1:8000/app/ctrl/index/%7B'_href':%20'/app/ctrl/func',%20'_target':%20'blank'%7D


and

Solution 2:
('', False, A('Label', _href=URL(...), _target='blank'))

gave this link: http://127.0.0.1:8000/app/ctrl/index/%3Ca%20href= 

But if I used the A(...) code in a controller, it prints to console and 
screen with correct HTML.

Has there been a change in code? Please assist... Thanks!




On Monday, April 15, 2013 at 9:50:29 AM UTC+8, Anthony wrote:
>
> A menu item can be specified like this:
>
> ('Label', False, dict(_href=URL(...), _target='blank'))
>
> or this:
>
> ('', False, A('Label', _href=URL(...), _target='blank'))
>
> Note, in the second case, the third element can be any HTML helper object 
> (including nested helpers).
>
> Anthony
>
> On Sunday, April 14, 2013 6:09:56 PM UTC-4, BlueShadow wrote:
>>
>> Hi,
>> I like to be able to set some link attributes in my response menu:
>> I want some links to open in a new tab: target="blank"
>> and I would love to set some alt atributes for the links in the response 
>> menu.
>> Is that even possible?
>> 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] multiple controllers with one view

2018-08-20 Thread Nico de Groot
The error is shown because you only send a variable 'id' to the view.  All 
variables used in the view should be send in the dict you return from the 
controller. Please check the web2py book on the website on views and  
controllers.

Nico

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