[web2py] Re: cache response.render in views

2018-02-24 Thread Dave S


On Friday, February 23, 2018 at 7:29:32 PM UTC-8, 黄祥 wrote:
>
> according to book : 
> http://web2py.com/books/default/chapter/29/04/the-core?search=response.render,
>  
> the response.render is used in controllers, let say, my controller is 
> contain nested loop and i decide to put it on views, but i don't want to 
> lose the web2py cache function
>

normally, Stifan's posts are easy to read, but this one I don't 
understand.  iterselect() is being used, but I don't see the looping ... is 
that being done by jquery calls?

*e.g.*
> *controllers/default.py*
> @cache.action(time_expire = cache_time_expire, cache_model = cache_model, 
> quick = cache_quick, prefix = cache_prefix)
> def report_bank():
> rows_currency = db(db.currency.id > 0).iterselect()
> return dict(rows_currency = rows_currency)
>
> and put the nested loop in views, my question is this function is cached 
> without assigned to response.render? if not how can i cache this function 
> using web2py way?
>
> thanks and best regards,
> stifan
>

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

2018-02-24 Thread Massimo Di Pierro
Please help us test the version of web2py which is posted on github.

I would like to release a new stable version and I would like to know if 
any of the changes has broken backward compatibility.
Also the icons are back in the latest welcome but use font-awesome.

Please check it. Thanks.

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] Error using Postgres

2018-02-24 Thread Massimo Di Pierro
I know. It is there and we distribute it but we will remove it in the next 
version.
I run into lots of problems with it, even with simple apps. psycopg2 works 
instead.


On Friday, 23 February 2018 04:57:41 UTC-6, Morganti wrote:
>
> Hi Dave,
>
> I found "pg8000" inside "gluon/contrib".
>
> In "gluon\packages\dal\pydal\adapters" I found the "postgres.py". So is it 
> wrong? Do I need to move pg8000 to "gluon\packages\dal\pydal\adapters"?
>
> You said about socket. I have no idea how to do it.
>
> Thanks a lot your support!
> Best regards
> Andre
>
> Em quinta-feira, 22 de fevereiro de 2018 18:30:17 UTC-3, Dave S escreveu:
>>
>>
>>
>> On Thursday, February 22, 2018 at 8:29:43 AM UTC-8, Morganti wrote:
>>>
>>> Hi, thanks your time.
>>>
>>> How can I check it? If I try to open web2py shell (web2py -S app -M), I 
>>> had no errors and all tables could be used.
>>>
>>> Thanks 
>>> BR
>>> André
>>>
>>>
>> That's one way to check.  The actual files should show up in the 
>> web2py/gluon/packages/dal/pydal/adapters, I think, and not just in 
>> gluon/contrib.
>>
>>
>> But the error looks, to my inexpert eye, like a socket error.  So I would 
>> start by verifying the socket exists and has the proper permissions. 
>>
>> /dps
>>
>> Em quinta-feira, 22 de fevereiro de 2018 13:08:23 UTC-3, Ovidio Marinho 
>>> escreveu:

 make sure the pg8000 and psycopg2 libraries are installed at the start 
 of web2py






[image: http://itjp.net.br] 
  http://itjp.net.b r
   *Ovidio Marinho Falcao Neto*
  ovid...@gmail.com
 Brasil
  

 2018-02-22 12:40 GMT-03:00 Morganti :

> Hello,
>
> I have a VPS using ubuntu 16.04, nginx, Postgres and web2py 2.16.1.
>
> I tried to execute one controller that populate some tables and got 
> the error below.
>
> Then, I used that command to create a csv file with all tables and 
> uploaded it in my desktop using SQLITE and no error were found.
>
> The controller coud create some rows before the error.
>
> Traceback (most recent call last):
>   File "/home/www-data/py27env/web2py/gluon/restricted.py", line 219, in 
> restricted
> exec(ccode, environment)
>   File 
> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py",
>  line 633, in 
>   File "/home/www-data/py27env/web2py/gluon/globals.py", line 419, in 
> 
> self._caller = lambda f: f()
>   File 
> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py",
>  line 21, in gera_plano_carreira
> vgraduacao = gera_graduacao()
>   File 
> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py",
>  line 56, in gera_graduacao
> for r in rows:
>   File 
> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", line 
> 3039, in __iter__
> row = next(self)
>   File 
> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", line 
> 3014, in __next__
> db_row = self.cursor.fetchone()
>   File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 
> 947, in fetchone
> return next(self)
>   File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 
> 1032, in __next__
> self._c.handle_messages(self)
>   File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 
> 2088, in handle_messages
> raise self.error
> ProgrammingError: (u'ERROR', u'34000', u'portal "pg8000_portal_13259" 
> does not exist', u'postgres.c', u'1861', u'exec_execute_message', u'', 
> u'')
>
> *Thanks your helping.*
>
> *Best regards*
>
> *Andre*
>
> -- 
> 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+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.


[web2py] Re: controller with multiprocessing powers. Howto?

2018-02-24 Thread Massimo Di Pierro
Pierre is right. That is not the way to do it. This is an example of the XY 
problem.

One way to do it to use the scheduler your tasks and performs the queries 
in background.



On Thursday, 22 February 2018 07:11:06 UTC-6, Pierre wrote:
>
> i think the entry point to do multiprocessing in web2py is the 
> web2py-scheduler. Howewer with this tool you can't share objects betweeen 
> processes like you do using the multiprocessing python module so 
> synchronization might be an issue. There are other tools like for instance* 
> huey* but i am not sure it's easy to integrate with web2py. In case this 
> is feasible, i'd be interested in an Howto huey-web2py-integration :
>
> https://huey.readthedocs.io/en/latest/
>

-- 
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] Asobe Flash End of Life in 2020

2018-02-24 Thread Marco Mansilla
Would you please send those references?, Never saw that kind of stuff in
web2py docs of in users questions.

El 14 feb. 2018 19:11, "Bryan Nahrwold"  escribió:

I see references to Flash in some of the articles or book references for
Web2py.  Does Web2py have a dependence or Adobe Flash? If so, what is the
Roadmap to get off of that dependency by 2020?

-- 
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: accessing Exchange IMAP email

2018-02-24 Thread Massimo Di Pierro
I believe we dropped support of DAL('imap:...)


On Wednesday, 21 February 2018 10:41:40 UTC-6, Andrea Fae' wrote:
>
> I have an exchange server and usually I access to email using 
> "domain\username" and password...
>
> using # Replace user, password, server and port in the connection string
>
> # Set port as 993 for SSL supportimapdb = 
> DAL("imap://user:password@server:port", pool_size=1)
>
> what can I type in the user ? I tried "domain\username" but I cannot 
> access...
> Thank you
>

-- 
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: Connect to mysql via ssl

2018-02-24 Thread 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.


[web2py] Re: Asobe Flash End of Life in 2020

2018-02-24 Thread Massimo Di Pierro
Definitively no.

On Wednesday, 14 February 2018 16:11:39 UTC-6, Bryan Nahrwold wrote:
>
> I see references to Flash in some of the articles or book references for 
> Web2py.  Does Web2py have a dependence or Adobe Flash? If so, what is the 
> Roadmap to get off of that dependency by 2020?
>

-- 
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: Help with cascading drop down list

2018-02-24 Thread Massimo Di Pierro
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 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.scheduler.hpxyz#2791 - ERROR - we received a task that isn't there (15)

2018-02-24 Thread Leonel Câmara
Are you using immediate=True in your queue_task, looking at the redis 
version of the scheduler's code, seems like, particularly when you have a 
lot of workers, it could cause redis to try to run the task before it is 
commited in the database. If that's the problem we should look into the 
code and try to fix it but you could as a workaround remove imediate=True.

-- 
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: YouTube and MARKMIN

2018-02-24 Thread Martin Weissenboeck
Ok, I have found the anwser: it's the browser.
It has classified the code as "insecure".

embed:https://www.youtube.com/embed/x1w8hKTJ2Co



works as expected.

2018-02-24 15:58 GMT+01:00 Martin Weissenboeck :

> I want to embed a youtube video in a website, which is created with
> MARKMIN.
> There is a lot of different ideas and hints in the web, but nothing seems
> zu work.
>
>
> [[Video https://www.youtube.com/watch?v=x1w8hKTJ2Co]]
> creates a link to this video, but does not embed the video frame itself.
>
> iframe:http://www.youtube.com/embed/x1w8hKTJ2Co
> creates an iframe without content.
>
> iframe:https://www.youtube.com/watch?v=x1w8hKTJ2Co
> does no do anything.
>
>
> [[youTube embed:http://www.youtube.com/embed/x1w8hKTJ2Co]]
> shows a link without any action.
>
> 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.


Re: [web2py] _href to URL()

2018-02-24 Thread Yoel Benitez Fonseca
don't use URL at all, just do:

('TaC', False, A('TaC',
_href='https://static.domain.com/files/Terms_and_Conditions.pdf',
_target="_blank", vars=dict(attachment=True)))

If it gives an error call  the .xml() directly on A:

('TaC', False, A('TaC',
_href='https://static.domain.com/files/Terms_and_Conditions.pdf',
_target="_blank", vars=dict(attachment=True)).xml())

2018-02-24 12:18 GMT-05:00 'Annet' via web2py-users :
> I have the following link in a view:
>
> {{=A('TaC',
> _href='https://static.domain.com/files/Terms_and_Conditions.pdf',
> _target="_blank", vars=dict(attachment=True))}}
>
> I want to convert it to a menu item
>
> ('TaC', False, URL(???))
>
> How do I convert the _href to a URL()
>
>
> Kind regards
>
> Annet
>
> --
> 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.



-- 
Msc. Yoel Benítez Fonseca

-- 
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] _href to URL()

2018-02-24 Thread 'Annet' via web2py-users
I have the following link in a view:

{{=A('TaC', 
_href='https://static.domain.com/files/Terms_and_Conditions.pdf', 
_target="_blank", vars=dict(attachment=True))}}

I want to convert it to a menu item

('TaC', False, URL(???))

How do I convert the _href to a URL()


Kind regards

Annet

-- 
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] YouTube and MARKMIN

2018-02-24 Thread Martin Weissenboeck
I want to embed a youtube video in a website, which is created with MARKMIN.
There is a lot of different ideas and hints in the web, but nothing seems
zu work.


[[Video https://www.youtube.com/watch?v=x1w8hKTJ2Co]]
creates a link to this video, but does not embed the video frame itself.

iframe:http://www.youtube.com/embed/x1w8hKTJ2Co
creates an iframe without content.

iframe:https://www.youtube.com/watch?v=x1w8hKTJ2Co
does no do anything.


[[youTube embed:http://www.youtube.com/embed/x1w8hKTJ2Co]]
shows a link without any action.

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.