[web2py] Re: $.web2py.component

2018-03-03 Thread Anthony
On Saturday, March 3, 2018 at 2:14:29 PM UTC-5, Andrea Fae' wrote:
>
> Anthony, what is the difference between
>
>  $.web2py.component(url_materia + '?docente=' + v, 
> 'evento_materia');
>  
> and
>
>  $.web2py.component(url_materia + '?docente=' + v, 
> 'evento_materia','no','no',$('#evento_materia'));
>
> where is the complete syntax about this?
>

Relevant code is 
here: 
https://github.com/web2py/web2py/blob/b16e33ab652d567ba62fd810814864f124504375/applications/welcome/static/js/web2py.js#L401

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

2018-03-03 Thread Andrea Fae'
Anthony, what is the difference between

 $.web2py.component(url_materia + '?docente=' + v, 
'evento_materia');
 
and

 $.web2py.component(url_materia + '?docente=' + v, 
'evento_materia','no','no',$('#evento_materia'));

where is the complete syntax about this?
Thanks

Il giorno giovedì 18 gennaio 2018 23:59:08 UTC+1, Anthony ha scritto:
>
> On Thursday, January 18, 2018 at 2:58:47 PM UTC-5, Andrea Fae' wrote:
>>
>> Anthony, you are very good teacher. But can I have a couple of examples 
>> using web2py and javascript? thank in advance.
>>
>
> Maybe think about specific use cases, try something, and come back with 
> specific questions if you can't get it working.
>

-- 
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: book help

2018-03-03 Thread villas
Where is the ASSIGNJS description in the book?
In the Github repo for the book,  issue 369 
 was merged?  
Also, are we still waiting for ANY_OF too?
Can someone who understands it,  please take a look.  
Many 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.


Re: [web2py] Re: Back button with an Ajax LOAD page

2018-03-03 Thread Val K

def router_example():

if request.vars.category_id: # - ajax call
return 'Category:%s content' % request.vars.category_id 

js="""
function ajax_route(){
console.log(window.location.hash);
var cat_id= window.location.hash.slice(1);
if (cat_id){
$.post('', 
$.param({category_id:cat_id})).then((d)=>$('#cat_content').html(d));};
}
$(document).ready(() => (window.addEventListener('hashchange', 
ajax_route),  ajax_route()));

"""
ret=DIV()
for cat_id in (1,2,3):
ret.append(A('category_%s'%cat_id, _style='margin-right:10px;', 
_href='#%s' % cat_id))
ret.append(DIV(_id='cat_content'))
ret.append(SCRIPT(js, _type='text/javascript'))
return dict(ret=ret)



On Saturday, March 3, 2018 at 5:15:49 PM UTC+3, Gaël Princivalle wrote:
>
> Thanks a lot. Do you have an little example?
>
> Il 3 mar 2018 9:01 AM, "Val K"  ha 
> scritto:
>
>> Hi, I think when page is reloaded history.pushState happens too, so there 
>> are 2 identical URL on the stack after page reloading.
>> If you want to manage routes by raw JS  It is simpler to use url#hash 
>> schema  and place  args (category_id=2 and so on) after #.  
>> In this case it's quite to listen hashchange event and perform ajax.load, 
>> no other tricks are required. 
>>
>> On Friday, March 2, 2018 at 4:36:28 PM UTC+3, Gaël Princivalle wrote:
>>>
>>> Hello.
>>>
>>> I've made a product page with the Ajax LOAD system:
>>> http://www.mompala.it/prodotti
>>>
>>> The idea is giving the possibility to the user to browse these products 
>>> without a page reload, and it works fine.
>>>
>>> The problem is that browsing the products don't change the url.
>>>
>>> I've made a script that changes the content depending of the url.
>>> If the url has a category_id like 
>>> http://www.mompala.it/prodotti?category_id=8 the load page will display 
>>> the products of this category.
>>> If the url has a product_id like 
>>> http://www.mompala.it/prodotti?product_id=325 the load page will 
>>> display this product.
>>>
>>> The problem still the history.
>>> The user must have the possibility to press the browser back button for 
>>> displaying the last content.
>>>
>>> Adding this script in the load page change the url in the browser url 
>>> bar, new_link is a link with the category_id or product_id:
>>> 
>>> history.pushState("", "", "{{=new_link}}");
>>> 
>>>
>>> Like that the back button change only the url bar content, not the page 
>>> content.
>>>
>>> For updating the page content I've added in the main page 'prodotti' 
>>> this script:
>>> 
>>> window.addEventListener('popstate', function(event) {
>>>   location.reload();
>>> });
>>> 
>>>
>>> And it works, but only for turning back to the last page.
>>> In other words, if the user wanted to turn back in the history 2 pages 
>>> in the past he can't.
>>>
>>> Someones knows why?
>>>
>>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/yepkcmzlR1c/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@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: Help with cascading drop down list

2018-03-03 Thread Val K
just for clarity:
JQuery is a Javascript library. Javascript doesn't have any relation to 
Java. Web2py also has nothing to do with Java. There is a misunderstanding 
when you talk about Java.
And yes, to do what you need, you should have understanding javascript. 
JQuery is quite enough for a simple application with some ajax tricks like 
yours. If you want to develop  a complex application with a rich UI, you 
have to study javascript much deeper, after that you won't have any 
questions about which library/framework  you'd better use (D3, Vue, 
Angular, React, Backbone, Knockout,  Ember ...+tons of others)


On Saturday, March 3, 2018 at 2:54:24 PM UTC+3, Matthew J Watts wrote:
>
> Ciao Massimo
>
> Thanks for getting back to me. Where do i start! As a beginner i'm 
> struggling to understand how i go developing the dependent /cascading drop 
> down list. 
>
> There seems to be several concepts i need to learn to be able build this - 
> i could do with a few pointers - what should i study ? Should i put my 
> efforts into learn java ,Jquery and ajax, then things will get clearer?  i 
> also want to incorporate data visualization into the app, so will think 
> about d3 too
>
> Sorry if i'm not making sense!
>
> Grazie
>
> Matt
>
>
>
> what do you want to do exctely? call a Java function from web2py?
>>
>>
>> On Monday, 12 February 2018 11:56:59 UTC-6, Matthew J Watts wrote:
>>>
>>> Can anyone point me in the right direction with this, any good tutorial 
>>> out there on how i can integrate java and web2py? 
>>>
>>> On Friday, February 9, 2018 at 12:05:32 PM UTC+1, Matthew J Watts wrote:

 Thanks for your reponse David!

 On Thursday, February 8, 2018 at 8:56:19 PM UTC+1, Dave S wrote:
>
>
>
> On Thursday, February 8, 2018 at 9:55:25 AM UTC-8, Matthew J Watts 
> wrote:
>>
>> Hi community
>>
>> I'm having a few problems trying to understand how create a cascading 
>> drop down list. I've followed this recipe -
>>
>>
>> http://www.web2pyslices.com/slice/show/1526/cascading-drop-down-lists-with-ajax-2
>>
>> i've managed to adapt it slightly, but i'm having trouble trying to 
>> add more tables to the cascade/sequence 
>>
>
> I'm not much of a menu person (I make use of ordinary anchor links for 
> the most part), but that example was probably written when BootStrap2 was 
> the css/javascript in use.  Currently,  web2py ships with BootStrap3, 
> which 
> doesn't support more than 1 level of submenus.  If you use stupid.css (as 
> in applications/example), you might not have that limitation, but I can't 
> show you what you want.
>
>
>> It is quite difficult for me (a beginner) to suss out the logic 
>> behind it
>>
>>
> Menus typically control what is shown by using javascript to 
> manipulate CSS.  Simple menus may be CSS only, but then they'd be 
> statically defined.  
>
> Good luck!
>
> /dps
>
>  
>
>> So at the moment i have the code below, what i'm trying to do is 
>> return a list of values from  the "tax_class" table, based  on a 
>> selection from the "tax_phylum" table( based on sececting an entry  
>> from the kingdom table)
>>
>> *model*
>>
>> db.define_table('tax_kingdom',
>> Field('name'))
>>
>> db.define_table('tax_phylum',
>> Field('name', 'string'),
>> Field('kingdom_id'))
>> db.tax_phylum.kingdom_id.requires = IS_IN_DB(db, db.tax_kingdom.id, 
>> '%(name)s')
>>
>> db.define_table('tax_class',
>> Field('name', 'string'),
>> Field('phylum_id'))
>> db.tax_class.phylum_id.requires = IS_IN_DB(db, db.tax_phylum.id, 
>> '%(name)s')
>>
>>
>> *Controller*
>>
>> def index():
>> kingdoms = db().select(db.tax_kingdom.ALL)
>>
>> if request.vars.kingdom_name:
>> phylum_select = db(db.tax_phylum.id == 
>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>> else:
>> phylum_select = db(db.tax_phylum.id == 
>> 1).select(db.tax_phylum.ALL)
>> return dict(kingdoms=kingdoms, phylum_select=phylum_select)
>>
>>
>> def phylum():
>> phylums = db(db.tax_phylum.kingdom_id == 
>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>> result = ""
>> for p in phylums:
>> result += "" + p.name + 
>> ""
>> return XML(result)
>>
>>
>>
>> *view*
>>
>>
>>
>> {{extend 'layout.html'}}
>>
>> 
>> > onchange="jQuery('#kingdom_name').empty();
>> ajax('phylum', ['kingdom_name'], 'phylum_name');">
>> {{for kingdom in kingdoms:}}
>> > {{=" selected='selected'" if 
>> str(kingdom.id)==request.vars.kingdom_name else ""}}>

Re: [web2py] Re: Back button with an Ajax LOAD page

2018-03-03 Thread Gaël Princivalle
Thanks a lot. Do you have an little example?

Il 3 mar 2018 9:01 AM, "Val K"  ha scritto:

> Hi, I think when page is reloaded history.pushState happens too, so there
> are 2 identical URL on the stack after page reloading.
> If you want to manage routes by raw JS  It is simpler to use url#hash
> schema  and place  args (category_id=2 and so on) after #.
> In this case it's quite to listen hashchange event and perform ajax.load,
> no other tricks are required.
>
> On Friday, March 2, 2018 at 4:36:28 PM UTC+3, Gaël Princivalle wrote:
>>
>> Hello.
>>
>> I've made a product page with the Ajax LOAD system:
>> http://www.mompala.it/prodotti
>>
>> The idea is giving the possibility to the user to browse these products
>> without a page reload, and it works fine.
>>
>> The problem is that browsing the products don't change the url.
>>
>> I've made a script that changes the content depending of the url.
>> If the url has a category_id like http://www.mompala.it/prodotti
>> ?category_id=8 the load page will display the products of this category.
>> If the url has a product_id like http://www.mompala.it/prodotti
>> ?product_id=325 the load page will display this product.
>>
>> The problem still the history.
>> The user must have the possibility to press the browser back button for
>> displaying the last content.
>>
>> Adding this script in the load page change the url in the browser url
>> bar, new_link is a link with the category_id or product_id:
>> 
>> history.pushState("", "", "{{=new_link}}");
>> 
>>
>> Like that the back button change only the url bar content, not the page
>> content.
>>
>> For updating the page content I've added in the main page 'prodotti' this
>> script:
>> 
>> window.addEventListener('popstate', function(event) {
>>   location.reload();
>> });
>> 
>>
>> And it works, but only for turning back to the last page.
>> In other words, if the user wanted to turn back in the history 2 pages in
>> the past he can't.
>>
>> Someones knows why?
>>
>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/yepkcmzlR1c/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.


Re: [web2py] Re: Help with cascading drop down list

2018-03-03 Thread 'Matthew J Watts' via web2py-users
Ciao Massimo

Thanks for getting back to me. Where do i start! As a beginner i'm
struggling to understand how i go developing the dependent /cascading drop
down list,  eventually i also want to start using the d3 library with my
app.
There seems to be several concepts i need to learn to be able build the
'drop down' this - i could do with a few pointers - what should i study
other than the web2py book

Should i put my efforts into learn java ,Jquery and ajax, then things will
get clearer?

Sorry if i'm not making sense!

Grazie

Matt



On Sun, Feb 25, 2018 at 3:27 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> what do you want to do exctely? call a Java function from web2py?
>
>
> On Monday, 12 February 2018 11:56:59 UTC-6, Matthew J Watts wrote:
>>
>> Can anyone point me in the right direction with this, any good tutorial
>> out there on how i can integrate java and web2py?
>>
>> On Friday, February 9, 2018 at 12:05:32 PM UTC+1, Matthew J Watts wrote:
>>>
>>> Thanks for your reponse David!
>>>
>>> On Thursday, February 8, 2018 at 8:56:19 PM UTC+1, Dave S wrote:



 On Thursday, February 8, 2018 at 9:55:25 AM UTC-8, Matthew J Watts
 wrote:
>
> Hi community
>
> I'm having a few problems trying to understand how create a cascading
> drop down list. I've followed this recipe -
>
> http://www.web2pyslices.com/slice/show/1526/cascading-drop-
> down-lists-with-ajax-2
>
> i've managed to adapt it slightly, but i'm having trouble trying to
> add more tables to the cascade/sequence
>

 I'm not much of a menu person (I make use of ordinary anchor links for
 the most part), but that example was probably written when BootStrap2 was
 the css/javascript in use.  Currently,  web2py ships with BootStrap3, which
 doesn't support more than 1 level of submenus.  If you use stupid.css (as
 in applications/example), you might not have that limitation, but I can't
 show you what you want.


> It is quite difficult for me (a beginner) to suss out the logic behind
> it
>
>
 Menus typically control what is shown by using javascript to manipulate
 CSS.  Simple menus may be CSS only, but then they'd be statically defined.

 Good luck!

 /dps



> So at the moment i have the code below, what i'm trying to do is
> return a list of values from  the "tax_class" table, based  on a
> selection from the "tax_phylum" table( based on sececting an entry
> from the kingdom table)
>
> *model*
>
> db.define_table('tax_kingdom',
> Field('name'))
>
> db.define_table('tax_phylum',
> Field('name', 'string'),
> Field('kingdom_id'))
> db.tax_phylum.kingdom_id.requires = IS_IN_DB(db, db.tax_kingdom.id, 
> '%(name)s')
>
> db.define_table('tax_class',
> Field('name', 'string'),
> Field('phylum_id'))
> db.tax_class.phylum_id.requires = IS_IN_DB(db, db.tax_phylum.id, 
> '%(name)s')
>
>
> *Controller*
>
> def index():
> kingdoms = db().select(db.tax_kingdom.ALL)
>
> if request.vars.kingdom_name:
> phylum_select = db(db.tax_phylum.id == 
> request.vars.kingdom_name).select(db.tax_phylum.ALL)
> else:
> phylum_select = db(db.tax_phylum.id == 
> 1).select(db.tax_phylum.ALL)
> return dict(kingdoms=kingdoms, phylum_select=phylum_select)
>
>
> def phylum():
> phylums = db(db.tax_phylum.kingdom_id == 
> request.vars.kingdom_name).select(db.tax_phylum.ALL)
> result = ""
> for p in phylums:
> result += "" + p.name + 
> ""
> return XML(result)
>
>
>
> *view*
>
>
>
> {{extend 'layout.html'}}
>
> 
>  onchange="jQuery('#kingdom_name').empty();
> ajax('phylum', ['kingdom_name'], 'phylum_name');">
> {{for kingdom in kingdoms:}}
>  {{=" selected='selected'" if 
> str(kingdom.id)==request.vars.kingdom_name else ""}}>
> {{=kingdom.name}}
> 
> {{pass}}
> 
>
>
> 
> 
> {{for phylum in phylum_select:}}
>  {{=XML(" selected='selected'") if 
> str(phylum.id)==request.vars.phylum_name else ""}}>
> {{=phylum.name}}
> {{pass}}
> 
>
>
> 
>
> --
> 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 

[web2py] Re: Connect to mysql via ssl

2018-03-03 Thread Scorpa
MySQL

воскресенье, 25 февраля 2018 г., 5:31:10 UTC+3 пользователь Massimo Di 
Pierro написал:
>
> Wedo not support that at this time. What database?
>
> On Sunday, 18 February 2018 02:40:57 UTC-6, Scorpa wrote:
>>
>> Hello, experts!
>>
>>
>> How to connect to mysql server via client certificate ? 
>>
>

-- 
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: please help us test trunk web2py

2018-03-03 Thread Val K
tried web2py_on_gevent.exe

Traceback (most recent call last):
  File "", line 6, in 
  File "__main__.py", line 128, in 
  File "__main__web2py_on_gevent__.py", line 21, in 
  File "gevent/monkey.py", line 190, in patch_all
  File "gevent/monkey.py", line 146, in patch_ssl
  File "gevent/monkey.py", line 62, in patch_module
  File "gevent/ssl.py", line 15, in 
  File "ssl.py", line 97, in 
ImportError: No module named _ssl

On Friday, March 2, 2018 at 9:56:55 PM UTC+3, pbreit wrote:
>
> Thanks. I've already cloned. But remained confused how to update 
> correctly. Normally I would just "git pull" but am not sure if I need to do 
> something else to make sure DAL updated, too.
>

-- 
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: Back button with an Ajax LOAD page

2018-03-03 Thread Val K
Hi, I think when page is reloaded history.pushState happens too, so there 
are 2 identical URL on the stack after page reloading.
If you want to manage routes by raw JS  It is simpler to use url#hash 
schema  and place  args (category_id=2 and so on) after #.  
In this case it's quite to listen hashchange event and perform ajax.load, 
no other tricks are required. 

On Friday, March 2, 2018 at 4:36:28 PM UTC+3, Gaël Princivalle wrote:
>
> Hello.
>
> I've made a product page with the Ajax LOAD system:
> http://www.mompala.it/prodotti
>
> The idea is giving the possibility to the user to browse these products 
> without a page reload, and it works fine.
>
> The problem is that browsing the products don't change the url.
>
> I've made a script that changes the content depending of the url.
> If the url has a category_id like 
> http://www.mompala.it/prodotti?category_id=8 the load page will display 
> the products of this category.
> If the url has a product_id like 
> http://www.mompala.it/prodotti?product_id=325 the load page will display 
> this product.
>
> The problem still the history.
> The user must have the possibility to press the browser back button for 
> displaying the last content.
>
> Adding this script in the load page change the url in the browser url bar, 
> new_link is a link with the category_id or product_id:
> 
> history.pushState("", "", "{{=new_link}}");
> 
>
> Like that the back button change only the url bar content, not the page 
> content.
>
> For updating the page content I've added in the main page 'prodotti' this 
> script:
> 
> window.addEventListener('popstate', function(event) {
>   location.reload();
> });
> 
>
> And it works, but only for turning back to the last page.
> In other words, if the user wanted to turn back in the history 2 pages in 
> the past he can't.
>
> Someones knows why?
>
> 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.