[web2py] Re: Remove request_reset_password from Auth navmenu

2018-03-22 Thread pbreit
Delete this line in your application:
https://github.com/web2py/web2py/blob/master/applications/welcome/views/layout.html#L79

-- 
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: getting result of SQLFORM.widgets.checkboxes.widget

2018-03-22 Thread Dave S


On Thursday, March 22, 2018 at 6:54:16 PM UTC-7, Lee Carmichael wrote:
>
> Hey all, I'm trying to implement two check boxes where the first is 
> checked by default, but both or only the second are acceptable checked 
> patterns (at least one must be checked).
>
> In my controller I have the following:
>
> MY_OPTIONS = ['In-service view','Future view' ] 
>
> form = SQLFORM.factory(Field('search',requires=IS_NOT_EMPTY()),
>   Field('view', "list:string", 
> default=MY_OPTIONS[0],
> 
> widget=SQLFORM.widgets.checkboxes.widget, 
> 
> requires=[IS_IN_SET(MY_OPTIONS,  multiple=True),IS_NOT_EMPTY()])).process() 
>
> If I do a print request.vars.search I see the value entered in my search 
> field, as expected. However, when I do a print request.vars.view, I get a 
> "None". I'm totally lost with the widgets. Any insight would be greatly 
> appreciated.
>
> LSC
>

If I recall a discussion from a couple years ago, an un-checked checkbox 
will not be in the vars.

You might want to try searching the list for 'checkbox' ; I think topics 
from March and January of last year may be relevant.

/dps

-- 
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] getting result of SQLFORM.widgets.checkboxes.widget

2018-03-22 Thread Lee Carmichael
Hey all, I'm trying to implement two check boxes where the first is checked 
by default, but both or only the second are acceptable checked patterns (at 
least one must be checked).

In my controller I have the following:

MY_OPTIONS = ['In-service view','Future view' ] 

form = SQLFORM.factory(Field('search',requires=IS_NOT_EMPTY()),
  Field('view', "list:string", 
default=MY_OPTIONS[0],

widget=SQLFORM.widgets.checkboxes.widget, 

requires=[IS_IN_SET(MY_OPTIONS,  multiple=True),IS_NOT_EMPTY()])).process() 

If I do a print request.vars.search I see the value entered in my search 
field, as expected. However, when I do a print request.vars.view, I get a 
"None". I'm totally lost with the widgets. Any insight would be greatly 
appreciated.

LSC

-- 
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: How to escape apostrophes in view.html

2018-03-22 Thread Maurice Waka
Got the point. Let me redo the stuff. I'll let you know if I have any
trouble.
Regards

On 23 Mar 2018 1:54 AM, "Dave S"  wrote:

>
>
> On Thursday, March 22, 2018 at 9:42:00 AM UTC-7, Maurice Waka wrote:
>>
>> this is part of my view.html., a chat bot.
>> Am having a problem escaping the " ' " character.
>>
>
>> On Thu, Mar 22, 2018 at 7:32 PM, Anthony  wrote:
>>
>>> What does this have to do with web2py? And why do you have "content:
>>> \0027" in the body selector? What are you really trying to do?
>>>
>>> Anthony
>>>
>>>
>
> The body {content: ...} stuff works with .before and .after, no?  What
> does "\0027" do?
>
> But in what way are you having trouble?  If you're putting text into the
> view/chat.html file, a literal "*'*", or ', or ' (as per
> Anthony's reply) work just fine.  It also works just fine to have a literal
> "*'*" in the data being displayed (returned by the controller function,
> and obtained in a DB query in my test case).
>
> /dps
>
>
>
>
> --
> 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/o6loJy5SGWc/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: a tangled web has been woven - importing modules help

2018-03-22 Thread Lee Carmichael
I restarted the server but I finally realized you actually have to restart 
the process. Thanks for the help.

On Thursday, March 22, 2018 at 7:26:50 PM UTC-4, Anthony wrote:
>
> Did you restart the web server? Python caches imported modules, so it will 
> not reload the file again unless the interpreter is restarted.
>
> Anthony
>
> On Thursday, March 22, 2018 at 6:55:58 PM UTC-4, Lee Carmichael wrote:
>>
>> Hey all, I'm totally confusing myself about importing modules. I think 
>> the root of my problem is I didn't wrong before I learned how to do it 
>> right. Live and learn, right? But now I seem to be in a tangled mess.
>>
>> For background, in my controller, report.py, I have a a function called 
>> result and in it i'm importing "my_module" like so:
>>
>> def result():
>> import my_module
>>
>>
>> My issue is I have no idea where it's getting that module. I've added the 
>> following:
>>
>>
>> import os.path  
>> print os.path.abspath(my_module.__file__)
>>
>> and i see that it's importing from ".../web2py/my_module.py" (which I 
>> know is terrible). But if i delete my_module from .../web2py/, nothing 
>> happens. I'd expect it to break the app but it keeps on running and keeps 
>> on telling me it's importing the module from that very place where it now 
>> no longer exists.
>>
>> What concept(s) am I missing here? At this point I feel like I just need 
>> to delete my_module.py from everywhere I can find it, put it in the modules 
>> folder in my app, and go on. However, I'm not convinced that will fix my 
>> issues.
>>
>> 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: a tangled web has been woven - importing modules help

2018-03-22 Thread Anthony
Did you restart the web server? Python caches imported modules, so it will 
not reload the file again unless the interpreter is restarted.

Anthony

On Thursday, March 22, 2018 at 6:55:58 PM UTC-4, Lee Carmichael wrote:
>
> Hey all, I'm totally confusing myself about importing modules. I think the 
> root of my problem is I didn't wrong before I learned how to do it right. 
> Live and learn, right? But now I seem to be in a tangled mess.
>
> For background, in my controller, report.py, I have a a function called 
> result and in it i'm importing "my_module" like so:
>
> def result():
> import my_module
>
>
> My issue is I have no idea where it's getting that module. I've added the 
> following:
>
>
> import os.path  
> print os.path.abspath(my_module.__file__)
>
> and i see that it's importing from ".../web2py/my_module.py" (which I know 
> is terrible). But if i delete my_module from .../web2py/, nothing happens. 
> I'd expect it to break the app but it keeps on running and keeps on telling 
> me it's importing the module from that very place where it now no longer 
> exists.
>
> What concept(s) am I missing here? At this point I feel like I just need 
> to delete my_module.py from everywhere I can find it, put it in the modules 
> folder in my app, and go on. However, I'm not convinced that will fix my 
> issues.
>
> 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] a tangled web has been woven - importing modules help

2018-03-22 Thread Lee Carmichael
Hey all, I'm totally confusing myself about importing modules. I think the 
root of my problem is I didn't wrong before I learned how to do it right. 
Live and learn, right? But now I seem to be in a tangled mess.

For background, in my controller, report.py, I have a a function called 
result and in it i'm importing "my_module" like so:

def result():
import my_module


My issue is I have no idea where it's getting that module. I've added the 
following:


import os.path  
print os.path.abspath(my_module.__file__)

and i see that it's importing from ".../web2py/my_module.py" (which I know 
is terrible). But if i delete my_module from .../web2py/, nothing happens. 
I'd expect it to break the app but it keeps on running and keeps on telling 
me it's importing the module from that very place where it now no longer 
exists.

What concept(s) am I missing here? At this point I feel like I just need to 
delete my_module.py from everywhere I can find it, put it in the modules 
folder in my app, and go on. However, I'm not convinced that will fix my 
issues.

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.


Re: [web2py] Re: How to escape apostrophes in view.html

2018-03-22 Thread Anthony
On Thursday, March 22, 2018 at 12:42:00 PM UTC-4, Maurice Waka wrote:
>
> this is part of my view.html., a chat bot.
> Am having a problem escaping the " ' " character.
>

Got it, but you haven't shown any code where you are using that character. 
And what is the point of setting the CSS "content" attribute on the body 
selector?

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: How to escape apostrophes in view.html

2018-03-22 Thread Dave S


On Thursday, March 22, 2018 at 9:42:00 AM UTC-7, Maurice Waka wrote:
>
> this is part of my view.html., a chat bot.
> Am having a problem escaping the " ' " character. 
>

> On Thu, Mar 22, 2018 at 7:32 PM, Anthony > 
> wrote:
>
>> What does this have to do with web2py? And why do you have "content: 
>> \0027" in the body selector? What are you really trying to do?
>>
>> Anthony
>>
>>

The body {content: ...} stuff works with .before and .after, no?  What does 
"\0027" do?

But in what way are you having trouble?  If you're putting text into the 
view/chat.html file, a literal "*'*", or ', or ' (as per 
Anthony's reply) work just fine.  It also works just fine to have a literal 
"*'*" in the data being displayed (returned by the controller function, and 
obtained in a DB query in my test case).

/dps




-- 
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: I was thinking about python2 clock

2018-03-22 Thread Anthony
On Thursday, March 22, 2018 at 3:26:31 PM UTC-4, Richard wrote:
>
> Take care if you run your app under python 3... It a no way back because 
> pickled object format change and you can't cleanly revert this change 
> back... Try it with a copy of your app.
>

Of course it is a good idea to back up your app before making any changes, 
but I wouldn't say there is "no way back." Files that contain pickled 
objects are the *.table database migration files, session files, and error 
tickets. It is easy to generate a new set of *.table files by setting 
fake_migrate_all=True, and session files and error tickets are generally 
ephemeral anyway.

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: I was thinking about python2 clock

2018-03-22 Thread Richard Vézina
Take care if you run your app under python 3... It a no way back because
pickled object format change and you can't cleanly revert this change
back... Try it with a copy of your app.

Richard

On Thu, Mar 22, 2018 at 3:13 PM, Ty oc  wrote:

> I think we2py should join the party!! and be on the list! :P
>
> http://python3statement.org/
>
>
> El martes, 20 de marzo de 2018, 16:14:58 (UTC-6), Leonel Câmara escribió:
>
>> I'm guessing the rewrite will take some time. One thing you can do is to
>> report any python3 problems you find with web2py while you do it. We'll fix
>> them.
>>
>> We've fixed many many python 3 compatibility problems on the last months,
>> you should be fine.
>>
> --
> 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: I was thinking about python2 clock

2018-03-22 Thread Ty oc
I think we2py should join the party!! and be on the list! :P

http://python3statement.org/


El martes, 20 de marzo de 2018, 16:14:58 (UTC-6), Leonel Câmara escribió:
>
> I'm guessing the rewrite will take some time. One thing you can do is to 
> report any python3 problems you find with web2py while you do it. We'll fix 
> them.  
>   
> We've fixed many many python 3 compatibility problems on the last months, 
> you should be fine.
>

-- 
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: I was thinking about python2 clock

2018-03-22 Thread Ty oc
That means that I can run right now web2py on python 3.5 or 3.6? if I 
update to master? (my webpy version is a little old).

Nice! will try!

El martes, 20 de marzo de 2018, 16:14:58 (UTC-6), Leonel Câmara escribió:
>
> I'm guessing the rewrite will take some time. One thing you can do is to 
> report any python3 problems you find with web2py while you do it. We'll fix 
> them.  
>   
> We've fixed many many python 3 compatibility problems on the last months, 
> you should be fine.
>

-- 
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: How to escape apostrophes in view.html

2018-03-22 Thread Maurice Waka
this is part of my view.html., a chat bot.
Am having a problem escaping the " ' " character.

On Thu, Mar 22, 2018 at 7:32 PM, Anthony  wrote:

> What does this have to do with web2py? And why do you have "content:
> \0027" in the body selector? What are you really trying to do?
>
> Anthony
>
>
> On Thursday, March 22, 2018 at 12:23:16 PM UTC-4, Maurice Waka wrote:
>
>> This is part of the code...
>>
>> 
>>
>> 

Re: [web2py] Re: How to escape apostrophes in view.html

2018-03-22 Thread Anthony
What does this have to do with web2py? And why do you have "content: \0027" 
in the body selector? What are you really trying to do?

Anthony

On Thursday, March 22, 2018 at 12:23:16 PM UTC-4, Maurice Waka wrote:
>
> This is part of the code...
>
> 
>
> 

Re: [web2py] Re: How to escape apostrophes in view.html

2018-03-22 Thread Maurice Waka
This is part of the code...




[web2py] Re: How to escape apostrophes in view.html

2018-03-22 Thread Anthony
Please show your code. ', ', or just plain ' should work.

Anthony

On Thursday, March 22, 2018 at 9:34:39 AM UTC-4, Maurice Waka wrote:
>
> Hi.
> An unable to display strings such as ; don't, can't, in the view.html.
> I've tried escaping in the  style body with content: \0027; as directed 
> from this 
>  
> site in vain.
> I have to refresh the page again for my content to appear.
> I need your help.
> 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] How to escape apostrophes in view.html

2018-03-22 Thread Maurice Waka
Hi.
An unable to display strings such as ; don't, can't, in the view.html.
I've tried escaping in the  style body with content: \0027; as directed 
from this 
 site 
in vain.
I have to refresh the page again for my content to appear.
I need your help.
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: Allow to add new record from formdropdown list

2018-03-22 Thread 黄祥
perhaps you can do it with bootstrap modal (in views) and dal table 
constructor comment
*e.g. (not tested)*
*models/db.**py*
db.Firmware.DeviceID.comment = A(_class="glyphicon glyphicon-plus-sign", **{
"_data-toggle":"modal", "_data-target":"#modal_device"} )

*controllers**/default.**py*
def modal_device():
 table = db.Device
 fields = None
 target_response = '(function($) 
{$("#modal_device").modal("hide");}(jQuery));'
 form = SQLFORM(table, fields = fields)
 if form.process(formname = 'form_modal').accepted:
 response.js = target_response
 redirect(request.env.http_web2py_component_location, client_side = True)
 elif form.errors:
 response.flash = 'form has errors'
 return dict(form = form)

def firmware():
 table = db.Firmware
 grid = SQLFORM.grid(table)
 return locals()

*views**/default/modal_device.**load*
{{=form}}

*views**/default/firmware.**html*
{{extend 'layout.html'}}
{{=grid}}

 
 
 
 ×
 {{=DIV(T('Device') ) }}
 
 
 {{=LOAD('master_marketing', 'modal_device.load', ajax = True) }}
 
 
 



best regards,
stifan

-- 
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] LDAP authentication questions

2018-03-22 Thread Johann Spies
On 15 March 2018 at 16:21, Richard Vézina  wrote:

> ...
> Good luck

Thank you Richard.  Your comments helped me to a clearer understanding
of the problem and possible solutions.

Regards
Johann

-- 
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] Allow to add new record from formdropdown list

2018-03-22 Thread Tu Duong
Hi,


My database looks like this

db.define_table('Device', Field('Name'), format='%(Name)s')

db.define_table('Firmware', Field(DeviceID, 'reference Device', 
requires=IS_IN_DB(db, 'Device.id'), 

 Field('Name'))

I want to create a form that combine these 2 table fields. For Device, I 
want user to select the existing devices in the database (via the dropdown 
list), but if they don't see the device they want, they can add the new 
device without leaving the form (or maybe have a windows pop-up with new 
form to add Device, and when it's done, the drop-down list will have the 
new added device)

How can I do that in web2py?

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.