[web2py] Re: Google wallet widget wont initialize on the page

2017-12-24 Thread Massimo Di Pierro
That functionality has been implemented so long ago that I would not be 
surprised if it does not work any more. We should probably simply eliminate 
from contrib.

On Wednesday, 20 December 2017 01:02:36 UTC-6, Rahul wrote:
>
> Hi All,
>   I am trying to integrate and utilize the basic functionality for 
> "Google Wallet" for my web2py app and following the instructions given in 
> the online book. I've my own merchant ID and I have registered with 
> Google.  but the problem is that it does not seem to initialize the widget 
> on the HTML page. It  just shows and placeholder and when I click on it, it 
> shows below err -
>
> 404. That’s an error. 
> The requested URL /api/checkout/v2/checkoutForm/Merchant/ was 
> not found on this server. That’s all we know. 
>
> *Code in the view *- (Ofcourse merchant_id I used the one google provided 
> me.  ) 
>
> {{from gluon.contrib.google_wallet import button}}
> {{=button(merchant_id="123456789012345",
>products=[dict(name="shoes",
>   quantity=1,
>   price=23.5,
>   currency='USD',
>   description="running shoes black")])}}
>
> I am using web2py version 2.15.3 - Any help/pointers for this would be 
> greatly appreciated. Does the code need to be updated or changed ? 
>
> Regards, Rahul
>
>

-- 
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: Asking support for MySQL create/alter column "AFTER" keyword

2017-12-24 Thread Massimo Di Pierro
look in web2py/gluon/packages/dal/pydal and search for "ALTER" in all files 
there and subfolders. It wiil give you and idea of how the logic is 
implemented.

On Monday, 18 December 2017 03:59:52 UTC-6, Alfonso Serra wrote:
>
> I would love to, have some time in December to spend in personal projects. 
> Any directions or shall i start researching the source code?
>

-- 
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: Js packages from browser

2017-12-16 Thread Massimo Di Pierro
This is fantastic!

On Monday, 11 December 2017 00:01:37 UTC-6, marco mansilla wrote:
>
> Just found this, looks nice.
>
>
> https://medium.com/@ericsimons/introducing-turbo-5x-faster-than-yarn-npm-and-runs-natively-in-browser-cc2c39715403
>  
> 
>

-- 
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: New Bootstrap 4 User Interface

2017-12-16 Thread Massimo Di Pierro
please do!

On Thursday, 7 December 2017 03:01:01 UTC-6, Oasis Agano wrote:
>
> Hello,
>
> The new user interface looks awesome, far more than the one that was there 
> for the previous versions.
> I wanted to know if someone(like me) can add a pull request on it on the 
> nav section to pull-right the user settings dropdown menu.
>
> instead of this one.
> So that we can have the username on the end right or if there is something 
> wrong with my suggestion.
>
> Thanks.
> Oasis
>
>

-- 
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: Glyphicons not showing

2017-12-16 Thread Massimo Di Pierro
Will be fixed in next version of web2py. Problem is that class names are 
different... need to rename them all.

On Thursday, 7 December 2017 16:45:50 UTC-6, Alex Glaros wrote:
>
> From another thread here: Bootstrap 4 dropped the bootstrap 3 included 
> glyphicons. You need to use fontawesome or something like that and give a 
> ui dict to grid with the proper classes to use.
>
> Alex Glaros
>

-- 
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: Asking support for MySQL create/alter column "AFTER" keyword

2017-12-16 Thread Massimo Di Pierro
I would support to change. Can you help make it happen?

On Thursday, 7 December 2017 10:18:35 UTC-6, Alfonso Serra wrote:
>
> Hi everybody.
>
> I would like to ask for support for the create column "AFTER" another 
> column keyword so whenever we change something in our models the order of 
> the columns in the database is respected. I know this is a cosmetic change 
> but migrations wont mess up column order this way. In large databases with 
> many tables and more columns this may become a reason to disable automatic 
> migrations.
>
> Example:
> ALTER TABLE `bookings` ADD COLUMN `total_invoiced` DOUBLE NULL AFTER 
> `rooms`;
>
> Please let us know if its worth the new feature.
>
> Thanks
> King 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: Scheduler workers crash on usage of urllib

2017-12-16 Thread Massimo Di Pierro
fixed on gitghub. thanks for reporting it.

On Thursday, 7 December 2017 06:26:33 UTC-6, Ryan Herbert wrote:
>
> I found this issue: https://github.com/web2py/pydal/issues/498 which 
> denotes my exact problem, so it should be fixed soon (?). Not entirely sure 
> why this issue didn't come up when searching my error on google...
>
> On Wednesday, 6 December 2017 16:39:11 UTC+1, Ryan Herbert wrote:
>>
>> Hello,
>> I am currently experiencing an issue with my scheduler workers crashing 
>> on startup with the following error:
>>
>> Exception in thread Thread-1:
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
>> self.run()
>>   File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 637, in 
>> run
>> self.send_heartbeat(counter)
>>   File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 1161, 
>> in send_heartbeat
>> self.db._uri, folder=self.db._adapter.folder, decode_credentials=True
>> )
>>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 169, in __call__
>> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 474, in __init__
>> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 454, in __init__
>> self._adapter = adapter(**kwargs)
>>   File 
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/__init__.py"
>> , line 40, in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File 
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
>> , line 368, in __init__
>> super(SQLAdapter, self).__init__(*args, **kwargs)
>>   File 
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
>> , line 50, in __init__
>> self._initialize_(do_connect)
>>   File 
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/mysql.py"
>> , line 24, in _initialize_
>> user = self.credential_decoder(m.group('user'))
>>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 403, in 
>> credential_decoder = lambda cred: urllib.unquote(cred)
>> NameError: global name 'urllib' is not defined
>>
>> The workers are running inside a docker container and are started with 
>> the following command:
>> /usr/local/bin/gosu www-data python web2py.py -K myapp
>>
>>
>> I have made sure urllib is correctly installed, and as far as I can tell, 
>> it is. Or at least running a python shell and importing the module works. 
>> Does anyone have any insight as to why this might be happening ?
>>
>> 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: Get reference format representation on dal callbacks

2017-12-16 Thread Massimo Di Pierro
Can you please provide a complete example of what you want using pseudocode?

On Wednesday, 6 December 2017 10:31:57 UTC-6, Carlos Cesar Caballero wrote:
>
> Hi, I am building a module (plugin) that is using some "after insert" 
> and "after uptade" dal callbacks. The tables has references (relations) 
> and I need to obtain the referenced table string format instead of it's 
> id in the callback, and I need it to be generic. How can I achieve that? 
>
> 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.


[web2py] Re: UnicodeDecodeError with mssql3 in nvarchar field

2017-12-14 Thread Massimo Di Pierro
 Latin1_General_CI_AS must a configuration parameter of your database. 
web2py only works with utf8

On Sunday, 3 December 2017 23:26:00 UTC-6, Tim Richardson wrote:
>
> I have a unicode string retrieved via a query from a different database on 
> the same Windows Server (MS SQL 2008) .
> It is a name with an accent. At the time I process it, it is an 
> intermediate variable with type unicode. 
>
> When I try to save it to an nvarchar column, I get an error  
>
>
> File "C:\Users\tim\web2py_dev\gluon\packages\dal\pydal\adapters\base.py", 
> line 523, in update
> raise e
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 137: 
> ordinal not in range(128)
>
> this is python 2.7 on Window Server 2008.
> I get the error both on web2py 2.16.1 which checked-out DAL v17.11, 
> and in 2.14.6 with DAL v16.03
>
> I'm using mssql3. Apart from the connection string, I am only using 
> lazy_tables
>
> The database collation is Latin1_General_CI_AS
> The database column was varchar up until me encountering this problem; now 
> it is nvarchar. 
>  
> I don't understand this at all. Where is "ascii" coming from? Is there 
> some lingering table migration which is confusing the DAL? 
>
>
>
>
>

-- 
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: Virtual field error :'FieldVirtual' object has no attribute 'listable' in 2.16.1

2017-12-14 Thread Massimo Di Pierro
I am pretty sure this is fixed in the latest pydal git master. I will build 
a new web2py version asap.

On Sunday, 3 December 2017 18:38:51 UTC-6, dome wrote:
>
> Dear Massimo
>
> reference to this same problem:
> https://github.com/web2py/web2py/issues/1815
>
> I replaced gluon source with tester version. Give the same error
> 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] Help with icons

2017-12-03 Thread Massimo Di Pierro
In the old days of BS2 we used "icon icon-{name}" for icons. then to 
support BS3 we also added "glyphicon glyphicon-{name}". now we use BS4 and 
there are no more icons we have to use Font Awesome so we should add "fa 
fa-{name}". I can easily add this to sqlhtml.py and we will all be fine but 
we will have a proliferation of classes. Another option is to use define 
.icon and .icon-{name} for those classes that we use in the grid in terms 
of font awesome icons and add them to web2py-bootstrap4.css.

Preferences?

-- 
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: No-dropdown widget?

2017-12-03 Thread Massimo Di Pierro
instead of (the default)

 requires=IS_IN_DB(db, table) 

do

 requires=[IS_IN_DB(db, table)]

On Sunday, 3 December 2017 03:53:41 UTC-6, Dave S wrote:
>
> I defined a new table, where a field is a list reference to another 
> table.  Going into admin to populate the table's first few entries, the 
> field with the references has a huge dropdown (thousands!)  What widget 
> should I specify to not get a dropdown in admin; I probably also don't want 
> a dropdown if I make a non-admin form for this table.
>
> Thanks.
>
> /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] Re: Virtual field error :'FieldVirtual' object has no attribute 'listable' in 2.16.1

2017-12-03 Thread Massimo Di Pierro
I just fixed this in the master branch of pydal. Can you please confirm it 
is fixed for you?

On Saturday, 2 December 2017 18:26:12 UTC-6, icodk wrote:
>
> Virtual field definition generate error in 
> 2.16.1-stable+timestamp.2017.11.14.05.54.25
> Works  fine in  2.14.06
> my field definition is:
>
> db.zone.inside = Field.Virtual('inside', lambda row: 1)
>
> I get the following error:
>
> 'FieldVirtual' object has no attribute 'listable'
>
> The field is defined just before a call to grid = 
> SQLFORM.smartgrid(db.zone,...
>
> Thanks for any help
>
>

-- 
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: mounting web2py at sub URL apache mod_wsgi

2017-12-02 Thread Massimo Di Pierro
why? everybody here has moved away from apache2 and does not look look 
mod_wsgi is very well supported. We strongly recommend nginx.

On Thursday, 30 November 2017 18:40:29 UTC-6, roland wrote:
>
> I cannot figure out how to install web2py to work on a sub URL. This 
> matter has been discussed back in 2009, but unfortunately, without a 
> definitive result. How can one proceed, are there any instructions 
> available for apache2 with mod_wsgi?
>
> Thanks a lot!
> Roland 
>
>
>

-- 
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: Possible bug using | at end of element of list:string

2017-12-02 Thread Massimo Di Pierro
I agree this is a bug. The problem is that this means our internal 
representation is ambiguous. We cannot fix this without changing the 
internal representation and breaking backward compatibility.
Will think of a solution. Thanks for catching this.

On Wednesday, 29 November 2017 07:12:56 UTC-6, Scott Hunter wrote:
>
> Suppose I have a list:string field, and I put `A|B` in for one of the 
> elements.  This works as expected, and gets represented internally as 
> `|A||B|`.
>
> Now suppose I break that up into 2 elements: `A|` followed by `B`.  When I 
> submit the form (a smart grid, in my case), it comes back with a single 
> element: `A||B`, with the internal representation `|A|||B|`.
>
> The same thing happens if the 2 elements as `A` followed by `|B`: single 
> element `A||B`, internally `|A||B|`.
>
> This looks like a bug to me, but thought I'd check here first.  I'm using 
> v2.16.1 under python2.7 on MacOS 10.12.6
>
> - Scott
>

-- 
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 OpenID or Oauth2 provider

2017-12-02 Thread Massimo Di Pierro
web2py can be used as Oauth/Open ID consumer but I do not believe anybody 
has written a provider app.

On Wednesday, 29 November 2017 11:13:57 UTC-6, Carlos Cesar Caballero wrote:
>
> Hi, is out there a working web2py Oauth2 or OpenID provider 
> implementation? The Idea is to use an intranet web2py-bassed application 
> as a auth provider for other services. I know that web2py comes with CAS 
> integrated, but there are not too many software with CAS support. 
>
> 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.


Re: [web2py] Web2Py + VueJS SPA (Webpack)

2017-11-27 Thread Massimo Di Pierro
I agree. I wish there was a way (and may be there is but I do not know) to 
to what webpack does from inside the browser of the developer so that the 
developer does not have to install node. If that were possible we could 
distribute vue components with web2py and not worry about users installing 
the node stack. 

Massimo

On Monday, 27 November 2017 14:13:27 UTC-6, José L. wrote:
>
> Massimo, I am sure most of the people in this group agree with you, having 
> the same preference. Coming from the python world we feel more comfortable 
> using that kind of js interaction.
> I am one of them, and I chose web2py for my personal work some  years ago 
> because of its simplicity against other frameworks complexity.
> However, working as you mentioned force you to miss most of the rich 
> environment available using node modules.
>
> Unfortunately, nowadays to build a modern web site you need to be fluent 
> in 5 "languages" at least (python, JavaScript, html, css & sql) plus some 
> frameworks (web2py, bootstrap, vue/react, not to mention other things like 
> sqlalchemy in some cases). I agree it's not comfortable at all, but 
> currently I see only two solutions for it:
>
> 1. If you can work exclusively for chrome/firefox you will be able to work 
> with node-modules in the browser, without the cli , using an elegant 
> solution as 
> https://medium.com/@oleg.agapov/basic-single-page-application-using-vue-js-and-firebase-part-1-9e4c0c11a228
>  
>
> 2. In the medium term we might have webcomponents
>
> 3. Paid solutions like Anvil, https://anvil.works/,  allowing you to do 
> everything in Python 
>
> However, now, needing to support old versions of Firefox and Chrome, or 
> IE, Safari, Edge, etc. I don't see alternatives to the nightmare of webpack 
> and node cli if you want to do a modern application.
> I think the approach you mention in your email would be similar to be 
> copying python files inside our application directories instead of using 
> pip install to install complete packages. So, my opinion is that we should 
> work on having a polished approach for future versions of web2py, similar 
> to what PHP Laravel community did with vue.
>
>
> José L.
>
> 2017-11-26 21:21 GMT+01:00 Massimo Di Pierro <massimo.dipie...@gmail.com>:
>
>> It seems that using the cli is becoming standard these days but I still 
>> like the original simplicity of being able to write js without need for 
>> nodejs.
>>
>> I tend to program in this way:
>>
>>
>> #... in index.html
>>
>> 
>>
>>   
>>   next
>>
>>
>>   
>>   next
>>
>>
>>   
>>   start again
>>
>> 
>> 
>> 
>> 
>>
>> # in js/main.js
>> var app = {};
>> // make a component for each page or each reusable widget with a lazily 
>> loaded html
>> Vue.component('mypage', function (resolve, reject) {
>> axios.get('components/vue.mypage.html').then(function(res) { 
>> resolve(common_forms(res.data)); });
>> });
>> app.vue = new Vue({el:'#app data:{page:'mypage1'}, 
>> methods:{goto:function(page){app.vue.page=page;}}, filters:{}, components: 
>> {}});
>>
>>
>> # then I define the html for each component in its own lazily-loaded html 
>> file, for example
>> # in components/vue.mypage.html
>> 
>>I am the template for the mypage component.
>> 
>>
>>
>>
>> On Wednesday, 15 November 2017 09:33:28 UTC-6, Carlos A. Armenta Castro 
>> wrote:
>>
>>> Hi José,
>>>
>>> I'm not in a hurry, but I will appreciate so much your help.
>>>
>>> Thank you!
>>>
>>> P.S. Your recipe with the Webpack proxyTable is working like a charm in 
>>> my dev server. 
>>>
>>>> lso, in webpack.config.babel.js configuration file ,  if you add
>>>>
>>>>
>>>>   devServer: {
>>>> host: '127.0.0.1',
>>>> port: 8001,
>>>> historyApiFallback: false,
>>>> noInfo: true,
>>>> proxy: {
>>>>   '/yourapp/api/*': {
>>>> target: 'http://127.0.0.1:8080',
>>>> secure: false
>>>> // changeOrigin: true,
>>>> // pathRewrite: { '^/api': '' }
>>>>   }
>>>> },
>>>>   },
>>>>
>>>
>>> On Tue, Nov 14, 2017 at 12:58 PM, José Luis Redrejo <jredr...@gmail.com> 
>>> wrote:
>>>
>>>> Carlos, by the way, if you ar

[web2py] Re: scale web2py horizontally (nginx + uwsgi + postgresql)

2017-11-27 Thread Massimo Di Pierro
What information do you need in particular? Just make sure you use sticky 
sessions or sessions in db or sessions in cookies or no sessions and it 
scales horizontally like any other framework. Bottleneck is the db.

On Monday, 27 November 2017 07:20:58 UTC-6, Áureo Dias Neto wrote:
>
> I have a server with 8GB of RAM, running postgresql + nginx + uwsgi in 
> CentOS environment, I would like reviews on scalability
>

-- 
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] Web2Py + VueJS SPA (Webpack)

2017-11-26 Thread Massimo Di Pierro
It seems that using the cli is becoming standard these days but I still 
like the original simplicity of being able to write js without need for 
nodejs.

I tend to program in this way:


#... in index.html


   
  
  next
   
   
  
  next
   
   
  
  start again
   





# in js/main.js
var app = {};
// make a component for each page or each reusable widget with a lazily 
loaded html
Vue.component('mypage', function (resolve, reject) {
axios.get('components/vue.mypage.html').then(function(res) { 
resolve(common_forms(res.data)); });
});
app.vue = new Vue({el:'#app data:{page:'mypage1'}, 
methods:{goto:function(page){app.vue.page=page;}}, filters:{}, components: 
{}});


# then I define the html for each component in its own lazily-loaded html 
file, for example
# in components/vue.mypage.html

   I am the template for the mypage component.




On Wednesday, 15 November 2017 09:33:28 UTC-6, Carlos A. Armenta Castro 
wrote:
>
> Hi José,
>
> I'm not in a hurry, but I will appreciate so much your help.
>
> Thank you!
>
> P.S. Your recipe with the Webpack proxyTable is working like a charm in my 
> dev server. 
>
>> lso, in webpack.config.babel.js configuration file ,  if you add
>>
>>
>>   devServer: {
>> host: '127.0.0.1',
>> port: 8001,
>> historyApiFallback: false,
>> noInfo: true,
>> proxy: {
>>   '/yourapp/api/*': {
>> target: 'http://127.0.0.1:8080',
>> secure: false
>> // changeOrigin: true,
>> // pathRewrite: { '^/api': '' }
>>   }
>> },
>>   },
>>
>
> On Tue, Nov 14, 2017 at 12:58 PM, José Luis Redrejo  
> wrote:
>
>> Carlos, by the way, if you are not in a hurry I can prepare a proof of 
>> concept this weekend. I just can tell it really works because I am using it 
>> in a system in production.
>>
>> Of course, that's the develop setup, once develop is done in production 
>> we use nginx-uwsgi only, but in that case there's no cors problem as 
>> everything runs in the same server.
>>
>>
>> The only thing I miss in web2py (waving Massimo ;) ) is having something 
>> like http://pyramid-webpack.readthedocs.io/en/latest/ 
>>
>> It would allow us to write in the view  controller/function.html 
>> something like
>>
>> > href="{{=URL('static',webpack('controller/function.css'))}}"/>
>>
>> > src="{{=URL('static',webpack('controller/function.js'))}}">
>>
>>
>> It would fetch the built files using the dist/webpack-manifest.json 
>> automatically instead of having to write them manually. Now if I use js or 
>> css versioning I have to change the routes in the view whenever I execute 
>> webpack
>>
>> Regards
>> José L.
>>
>> 2017-11-14 20:37 GMT+01:00 José Luis Redrejo 
>>
>>> Hi Carlos
>>> I would recommend you to use this webpack helper:
>>> https://github.com/Plortinus/vue-multiple-pages
>>>
>>> Doing "vue init Plortinus/vue-multiple-pages new-project" you get the 
>>> structure to work, just add the div for app to the class and import the 
>>> page js per each page.
>>>
>>> Also, in webpack.config.babel.js configuration file ,  if you add
>>>
>>>
>>>   devServer: {
>>> host: '127.0.0.1',
>>> port: 8001,
>>> historyApiFallback: false,
>>> noInfo: true,
>>> proxy: {
>>>   '/yourapp/api/*': {
>>> target: 'http://127.0.0.1:8080',
>>> secure: false
>>> // changeOrigin: true,
>>> // pathRewrite: { '^/api': '' }
>>>   }
>>> },
>>>   },
>>>
>>>
>>> You can start web2py server, then webpack dev server and it will do 
>>> queries to web2py without any cors problem.
>>>
>>> i.e 
>>> http://localhost:8001/api/whatever will automatically be fetched from
>>> http://localhost:8080/yourapp/api/whatever
>>>
>>> That's how I set it up for web2py to be the backend, and webpack dev 
>>> server to run the frontend.
>>>
>>>
>>> Hope it helps
>>> José L.
>>>
>>> 2017-11-14 17:48 GMT+01:00 Carlos A. Armenta Castro <
>>> carlos.armen...@gmail.com>:
>>>
 I have using Web2Py for too many years for commercial websites and for 
 Intranets in México, I want to say that Web2Py is an AMAZING Framework!!! 
 For my new project I need to use an SPA VueJs + Webpack for the 
 FrontEnd  ( http://quasar-framework.org/ ) and a Web2Py as my BackEnd 
 API Server. 
 I'm curious about to integrate his two web frameworks using web2py 
 routes to serve this two apps in the same port but different URL.

 Example:
 http://127.0.1.1/welcome/api ---> My Web2py API Controller
 http://127.0.1.1/welcome   ---> My VueJS APP with webpack  ( 
 http://quasar-framework.org/ ) <-- Pointing to index.html in *dist/ * 
 and permit to use all the static files deposited in the same path 
 *dist/**

 *VueJS + Webpack APP Structure*

 ├── *dist/ * *# Compiled APP (Serve this files as the 
 static SPA)*
 │   *└── index.html 
 │   ├── fonts/ 
 │   │   └── ...
 

[web2py] Re: error: 'No module named sanitizer' after upgrading to 2.16.1

2017-11-21 Thread Massimo Di Pierro
check that you have
web2py/gluon/sanitizer.py
maybe you accidentally deleted it or maybe the user does not have read 
permission.
Another option is that you app does a non thread safe os.chdir()


On Monday, 20 November 2017 15:46:07 UTC-6, Ton Sjerps wrote:
>
> After upgrading from 2.15.4 it gave the ticket below.
> Unfortunately putting it back to the previous or an even older version did 
> not solve the problem.
> Searching the web it seems to be related to python libs *html5lib *and 
> *bleach* 
> reinstalling or updating them with 'pip install -U bleach' does not seem 
> to help and neither does installing a previous version of the html5lib with 
> 'pip install html5lib==1.0b9'
>
> The problem exists while testing locally on my laptop as well as on the 
> server. 
> The server I could only get back up and running by restoring it to the 
> backup off last night.
> (restored to version 2.14.6-stable+timestamp.2016.05.10.00.21.47  
> Apache/2.4.18 (Ubuntu), Python 2.7.12) 
>
> Anybody any suggestions on what the problem is and how to tackle it?
>
> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25 
> Python Python 2.7.14: D:\Python27\python.exe (prefix: D:\Python27) 
> Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
>
>
>
> Traceback (most recent call last):
>   File "F:\5-PCPROG\web2py_src\web2py\gluon\restricted.py", line 219, in 
> restricted
> exec(ccode, environment)
>   File "F:/5-PCPROG/web2py_src/web2py/applications/apa/controllers/orders.py" 
> , line 3, 
> in 
> from sanitizer import sanitize
>   File "F:\5-PCPROG\web2py_src\web2py\gluon\custom_import.py", line 104, in 
> custom_importer
> raise ImportError(e1, import_tb)  # there an import error in the module
> ImportError: (ImportError('No module named sanitizer',),  0x04E69748>)
>
>

-- 
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: Janrain recently broken (and how to fix)

2017-11-21 Thread Massimo Di Pierro
thanks Anthony

On Wednesday, 15 November 2017 14:00:12 UTC-6, Anthony wrote:
>
> If anyone is using web2py's Janrain integration, it looks like Janrain 
> recently made a change that breaks the web2py code. I submitted a pull 
> request to fix it, but in the meantime, a temporary workaround is to add 
> the following in the user() function (before the call to auth()):
>
> if request.post_vars.token:
> del request.get_vars.token
>
> The problem is that Janrain is now passing the token to the web2py URL via 
> both a POST variable and the query string. One of those two must be deleted 
> before calling auth() for the current web2py code to work.
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: where is pydal doc ?

2017-11-14 Thread Massimo Di Pierro
I can extend the documentation but I am not sure what people find is 
missing specifically. Can you ask some specific questions? how do I do 
[what]?

On Wednesday, 8 November 2017 08:40:33 UTC-6, Leonel Câmara wrote:
>
> Lars I think everyone agrees the pyDAL codebase should be better 
> documented. I even opened up an issue about it 
> https://github.com/web2py/pydal/issues/468
>
> I think what happened here was that people thought you wanted usage 
> documentation, the DAL's usage is pretty well documented in the web2py 
> book. The DAL code, not so much.  
>

-- 
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: revert to previous version of a record while using enable_record_versioning

2017-11-14 Thread Massimo Di Pierro
it is not implemented because I cannot see one size fits all. Often 
reverting is not as easy as reverting a single record.

On Tuesday, 14 November 2017 13:02:46 UTC-6, Pengfei Yu wrote:
>
> Hi,
>
> I am using "auth.enable_record_versioning" to track the version of each 
> record's update for my database tables. It works great now to keep 
> different previous versions of a record in the "*_archive" tables. For my 
> application, I also need features to allow some users to revert one record 
> back to one of the previous versions. I am wondering whether it is already 
> implemented as a function for versioning-enabled records.
> Such as:
> db[table1][id1].revert[id_archive]
>
> Here "db[table1][id1]" is one record in "table1" with id as "id1". And 
> "id_archive" is the id of the previous record in the "*_archive" table I 
> want to revert back to. 
>
> 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: Web2py and machine learning - scikit-learn

2017-11-14 Thread Massimo Di Pierro
I have. Works fine. 
You can import any python library in web2py as long as it is installed.
You can have issues with libraries that are not thread safe and if they 
are, you will have to lock when using them.
I do not know for sure which algos in scikit learn are thread safe and 
which ones are not. You have to check that.

Massimo

On Monday, 13 November 2017 23:57:25 UTC-6, GIsaac wrote:
>
> Hi all,
>
> I'm doing a project which will be based around web frameworks and 
> adaptivity using machine learning, and have been looking into the 
> possibility of using web2py.
>
> Is it possible to import/use the Scikit-learn library with web2py? Has 
> anyone here done this? 
> I understand that it is possible to import other python libraries into 
> web2py, however haven't seen any examples of people doing this with scikit 
> specifically.
>
> Many thanks for any help that can be given.
>

-- 
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 + VueJS SPA (Webpack)

2017-11-14 Thread Massimo Di Pierro
This is fantastic. Thank you Carlos,
please email me personally about you work. I think this is the path to the 
future of web2py.

On Tuesday, 14 November 2017 10:48:03 UTC-6, Carlos A. Armenta Castro wrote:
>
> I have using Web2Py for too many years for commercial websites and for 
> Intranets in México, I want to say that Web2Py is an AMAZING Framework!!! 
> For my new project I need to use an SPA VueJs + Webpack for the FrontEnd  
> ( http://quasar-framework.org/ ) and a Web2Py as my BackEnd API Server. 
> I'm curious about to integrate his two web frameworks using web2py routes 
> to serve this two apps in the same port but different URL.
>
> Example:
> http://127.0.1.1/welcome/api ---> My Web2py API Controller
> http://127.0.1.1/welcome   ---> My VueJS APP with webpack  ( 
> http://quasar-framework.org/ ) <-- Pointing to index.html in *dist/ * and 
> permit to use all the static files deposited in the same path *dist/**
>
> *VueJS + Webpack APP Structure*
>
> ├── *dist/ * *# Compiled APP (Serve this files as the 
> static SPA)*
> │   *└── index.html 
> │   ├── fonts/ 
> │   │   └── ...
> │   ├── static/ 
> │   │   └── ...
> │   ├── js/ 
> │   │   └── ...*
> ├── config/
> │   ├── index.js# main project config
> │   └── ...
> ├── src/
> │   ├── main.js # app entry file
> │   ├── App.vue # main app component
> │   ├── components/ # ui components
> │   │   └── ...
> │   └── assets/ # module assets (processed by webpack)
> │   └── ...
> ├── static/ # pure static assets (directly copied)
> ├── test/
> ...
>
> Actually I am doing this work in my NginX Server but I Will be happy if I can 
> do the same thing easily using pure web2py 
>
> Why using the same port?  Because the CORS issues, this is the best and easy 
> way to deal with CORS. I know I can use sub-domains in the same port, I know 
> I can use ALLOW ORIGIN headers in W2P side but that are not options for me in 
> this case.
>
> NginX config working:
>
> location / {
> index index.html index.htm;
> root /home/www-data/vue/applications/simott;
> try_files $uri $uri/ /index.html;
> }
>
> location /api {
> uwsgi_pass  unix:///tmp/web2py.socket;
> include uwsgi_params;
> uwsgi_param UWSGI_SCHEME $scheme;
> uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
>
>}
>
> Any recommendations? 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: web2py 2.16.1 is OUT

2017-11-14 Thread Massimo Di Pierro
Can you send me a simple app to reproduce the problem.

On Tuesday, 14 November 2017 12:20:03 UTC-6, Yoel Benitez Fonseca wrote:
>
> Got some strange result after the updates... im ussing pytest for 
> testing and the was a test for a submit form with was working últil 
> the update, the model: 
>
> db.define_table( 
> 'producto', 
> Field('nombre', 'string', length=50, unique=True, 
> label='Nombre:'), 
> Field('tipo_producto_id', 'reference tipo_producto', 
> label='Tipo:'), 
> Field('precio', 'float', label='Precio:'), 
> Field('descripcion', 'text', length=1250, label='Descripción:'), 
> Field('imagen', 'upload', label='Imagen:'), 
> Field('thumb', 'upload', writable=False, readable=False), 
> format='%(nombre)s') 
>
> The test will fail for db.tipo_producto_id allowing not in db 
> referenceuntil i got the to the code and explicity put the 
> validator: 
>
> db.producto.tipo_producto_id.requires = IS_IN_DB( 
> db, 'tipo_producto.id', '%(nombre)s' 
> ) 
>
> idk what was that about... other models defined on the app and not 
> defining explicid validator work as usual. 
>
> 2017-11-14 10:01 GMT-05:00 Massimo Di Pierro <massimo.dipie...@gmail.com>: 
>
> > check your models/menu.py you may have separators in the menu. The new 
> > layout does not support them. 
> > 
> > 
> > On Tuesday, 14 November 2017 02:22:51 UTC-6, 黄祥 wrote: 
> >> 
> >> Traceback (most recent call last): 
> >>   File "/Users/MacBookPro/project/python/web2py/gluon/restricted.py", 
> line 
> >> 219, in restricted 
> >> exec(ccode, environment) 
> >>   File 
> >> 
> "/Users/MacBookPro/project/python/web2py/applications/test/views/default/index.html",
>  
>
> >> line 60, in  
> >>   File "/Users/MacBookPro/project/python/web2py/gluon/html.py", line 
> 783, 
> >> in __getitem__ 
> >> return self.components[i] 
> >> IndexError: list index out of range 
> >> 
> >> views/default/index.html 
> >> {{extend 'layout.html'}} 
> >> {{include 'templates/index/index.html'}} 
> >> 
> >> views/templates/index/index.html 
> >> {{=H1(T('Test'), _align = 'Center' ) }} 
> >> 
> >> code in traceback line 60 is italic and bold: 
> >> for _item in response.menu or []: 
> >> response.write('\n  ', escape=False) 
> >> if len(_item)<4 or not _item[3]: 
> >> response.write('\n  \n', escape=False) 
> >> response.write(_item[0]) 
> >> response.write('\n  \n  ', 
> escape=False) 
> >> else: 
> >> response.write('\n  \n 
> >>  >> aria-expanded="false">', escape=False) 
> >> response.write(_item[0]) 
> >> response.write('\n\n 
> >> ', escape=False) 
> >> for _subitem in _item[3]: 
> >> response.write('\n   >> href="', escape=False) 
> >> response.write(_subitem[2]) 
> >> response.write('">', escape=False) 
> >> response.write(_subitem[0]) 
> >> response.write('\n  ', escape=False) 
> >> pass 
> >> response.write('\n\n  \n 
> >> ', escape=False) 
> >> pass 
> >> response.write('\n  ', escape=False) 
> >> 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. 
>
>
>
> -- 
> Msc. Yoel Benítez Fonseca 
> Dpto. Informática. Redacción Adelante 
> http://www.adelante.cu/ 
>

-- 
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: web2py 2.16.1 is OUT

2017-11-14 Thread Massimo Di Pierro
check your models/menu.py you may have separators in the menu. The new 
layout does not support them.

On Tuesday, 14 November 2017 02:22:51 UTC-6, 黄祥 wrote:
>
> *Traceback (most recent call last):*
>   File "/Users/MacBookPro/project/python/web2py/gluon/restricted.py", line 
> 219, in restricted
> exec(ccode, environment)
>   File 
> "/Users/MacBookPro/project/python/web2py/applications/test/views/default/index.html",
>  
> line 60, in 
>   File "/Users/MacBookPro/project/python/web2py/gluon/html.py", line 783, 
> in __getitem__
> return self.components[i]
> IndexError: list index out of range
>
> *views/default/index.html*
> {{extend 'layout.html'}}
> {{include 'templates/index/index.html'}}
>
> *views/templates/index/index.html*
> {{=H1(T('Test'), _align = 'Center' ) }}
>
> *code in traceback line 60 is italic and bold:*
> for _item in response.menu or []:
> response.write('\n  ', escape=False)
> if len(_item)<4 or not _item[3]:
> response.write('\n  \n', escape=False)
> response.write(_item[0])
> response.write('\n  \n  ', escape=False)
> else:
> response.write('\n  \n  
>aria-expanded="false">', escape=False)
> response.write(_item[0])
> response.write('\n\n
>   ', escape=False)
> for _subitem in _item[3]:
> response.write('\n   href="', escape=False)
> response.write(_subitem[2])
> response.write('">', escape=False)
> response.write(_subitem[0])
> response.write('\n  ', escape=False)
> pass
> response.write('\n\n  \n  
> ', escape=False)
> pass
> response.write('\n  ', escape=False)
> 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 2.16.1 is OUT

2017-11-13 Thread Massimo Di Pierro
I suspect you have two web2py running. Or maybe on update it did not 
correctly unzip. Can you try kill all and restart?

On Tuesday, 14 November 2017 00:15:12 UTC-6, Kiran Subbaraman wrote:
>
> Thanks for the new version. 
>
> Downloaded web2py_src from web2py.com, for Windows. Extracted, and ran 
> `python web2py.py`.
> In the browser see this message *"Requires web2py 2.15.5 or newer" . *Not 
> sure what the issue is?
>
> Python 2.7.12
> Windows 10
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2017
> Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
> Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, 
> pyodbc, mysqlconnector
> please visit:
>  http://127.0.0.1:8000/
> starting browser...
>
>
>
>
> On Tuesday, November 14, 2017 at 11:29:52 AM UTC+5:30, Massimo Di Pierro 
> wrote:
>>
>> web2py 2.16.1 is OUT
>>
>> Lots of bugs fixes contributed by the community. Thanks Leonel, Paolo, 
>> Giovanni, and all those who contributed.
>>
>> the most visible changes are:
>>
>> - welcome now defaults to bootstrap 4
>> - lots of cleanup in the welcome app and new examples in default.py
>> - simplified layout.html
>>
>> 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.


[web2py] web2py 2.16.1 is OUT

2017-11-13 Thread Massimo Di Pierro
web2py 2.16.1 is OUT

Lots of bugs fixes contributed by the community. Thanks Leonel, Paolo, 
Giovanni, and all those who contributed.

the most visible changes are:

- welcome now defaults to bootstrap 4
- lots of cleanup in the welcome app and new examples in default.py
- simplified layout.html

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.


[web2py] Re: forward auth.user record

2017-11-01 Thread Massimo Di Pierro
Absolutely both should be decorated.
You solve the problem by having some periodic ajax ping that keeps the 
session alive

On Wednesday, 1 November 2017 09:37:28 UTC-5, Pierre wrote:
>
> hello everyone,
>
> I have a decorated action | controller  (@auth.requires_login()) making an 
> ajax call to perform another action. Some time ago I realized that user 
> session might expire while the ajax is being processed so if ajax secondary 
> action does something like : *user = auth.user_id* and session has ended 
> i get *user=None* and actions won't get through
> In such situation is it good practice to forward the auth.user record (at 
> list auth.user_id) sothat it's available to use by the ajax ? or should 
> both actions be decorated ?
>
>

-- 
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: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Massimo Di Pierro
make sure web2py is in PYTHON_PATH

On Wednesday, 1 November 2017 08:19:02 UTC-5, Omicron VT wrote:
>
>
>
> El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió:
>>
>> I have been using websocket_messaging.py without problems in version 
>> 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging 
>> anymore, iget this error :
>> ImportError: No module named gluon.utils
>>
>> Any help ? Thanks
>>
>
> Yes, but no solution.
>
> I think this lines(96-97) in messaging_websocket.py are the problem :
> import gluon.utils
> from gluon._compat import to_native, to_bytes, urlencode, urlopen
>
> and if i try to import /gluon/utils.py from python console i get a similar 
> error:
>   File "utils.py", line 30, in 
> from gluon._compat import basestring, pickle, PY2, xrange, to_bytes, 
> to_native
> ImportError: No module named gluon._compat
>
>
>

-- 
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: websocket_messaging incompatible in web2py 2.15.4?

2017-11-01 Thread Massimo Di Pierro
No Looks like pypyodbc is not installed properly

On Saturday, 21 October 2017 08:12:29 UTC-5, mweissen wrote:
>
> Some months ago I have written a test application for 
> gluon/contrib/websocket_messaging.py and it worked very well. Now (after an 
> update to 2.15.4) I tried it again and I got some errors.
>
> I started with 
>
> python /home/www-data/web2py/gluon/contrib/websocket_messaging.py -k mykey 
> -p  -s /etc/nginx/ssl/web2py.key -c /etc/nginx/ssl/web2py.crt
>
>
> and I got the message, that gluon.contrib was not found.
>
> I added the line 
>
> sys.path.append('/home/www-data/web2py/')
>
> before import gluon.contrib and this solved the problem. Maybe not the 
> best solution, but it worked.
>
> I tried it again and got:
>
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/contrib/websocket_messaging.py", line 
> 97, in 
> import gluon.utils
>   File "/home/www-data/web2py/gluon/__init__.py", line 23, in 
> import pydal
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/__init__.py", line 
> 3, in 
> from .base import DAL
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/base.py", line 147, 
> in 
> from .adapters.base import BaseAdapter, NullAdapter
>   File 
> "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 
> 73, in 
> from .postgres import Postgre, PostgrePsyco, PostgrePG8000
>   File 
> "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 4, in 
> from ..drivers import psycopg2_adapt
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/drivers.py", line 
> 71, in 
> import pypyodbc as pyodbc
>   File "/home/www-data/web2py/gluon/contrib/pypyodbc.py", line 439, in 
> 
> raise OdbcNoLibrary('ODBC Library is not found. Is LD_LIBRARY_PATH 
> set?')
> pypyodbc.OdbcNoLibrary: 'ODBC Library is not found. Is LD_LIBRARY_PATH 
> set?'
>
>
> Is there anything new in 2.15.4, which ​is responsible for this message? I 
> think that nothing else has changed.
>
> Version: 2.15.4-stable+timestamp.2017.09.02.04.02.22
> (läuft auf nginx/1.10.0, Python 2.7.12)​
>
> Regards, Martin
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Increment the value of a field + 1 or how to auto-increment a field value ?

2017-11-01 Thread Massimo Di Pierro
I guess what I meant is that you have a possible concurrency problem:

max_id=db(db.invoice.company_id==auth.user.company_id).select 
(db.invoice.invoice_number, orderby=~db.invoice.invoice_number, limitby= 
(0,1)).first().invoice_number
db.invoice.invoice_number.default = max_id + 1
form=SQLFORM(db.invoice).process()

since two users may compute the same max_id and then submit two invoices.
You have to make sure the invoice_number is defined as unique


On Saturday, 21 October 2017 07:34:49 UTC-5, Rudy wrote:
>
> Hi Massimo,
>
> I have a multi tenant invoicing system serving multiple companies, all 
> invoices from different companies are stored in a single table flagged with 
> company_id. I would like each company being able to have their own 
> invoice_number starting from 1 and increment up. 
> db.define_table('invoice',
> Field('invoice_number', 'integer'),
> Field('customer', 'reference customer'),
> Field('total', 'double', default=0),
> Field('company_id', 'integer', readable=False, 
> writable=False))
>
> If i do (auth_user table has an additional field company_id)  
>
> max_id=db(db.invoice.company_id==auth.user.company_id).select 
> (db.invoice.invoice_number, orderby=~db.invoice.invoice_number, limitby= 
> (0,1)).first().invoice_number
> db.invoice.invoice_number.default = max_id + 1
> form=SQLFORM(db.invoice).process()
>
> It works but like you said it can't support multiple user creating 
> invoices at the same time. Any suggestion what I can do to support multiple 
> users creating invoices for a specific company at the same time? Thanks! 
> Rudy
>
>
>
> On Sunday, September 27, 2009 at 6:51:34 AM UTC+8, mdipierro wrote:
>>
>> You have to do it in two steps 
>>
>> max_id=db(db.table.questionary_id==1).select 
>> (db.table.question_number,orderby=~db.question.number,limitby= 
>> (0,1)).first().question_number 
>> db.table.insert(,question_number=max_id+1) 
>>
>> and make sure that one user at the time is editing this one 
>> questionary. 
>>
>> On Sep 26, 4:45 pm, ProfessionalIT  wrote: 
>> > > Question Number = 02 (get the last(max)(where the 
>> questionary_id=1) value of this field + 1) 
>> > 
>> >  Well, in a crud create form I have this questionary_id, it is shown 
>> > how a html select field.
>
>

-- 
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: Web Services for Remote Portlets?

2017-10-18 Thread Massimo Di Pierro
Never heard of a portlet before. I looked it up and I doubt you will get 
much help about them in this mailing list. It is not a common protocol. 
Nothing prevents web2py from interoperating with it but it is not something 
I intend to support.


On Tuesday, 17 October 2017 21:39:05 UTC-5, IVINH wrote:
>
> From the web2py application, I need to use another portal portlet 
> (liferay, sharepoint,..). How to do it?
> Do you have any examples of Web Services for Remote Portlets (WSRP) ?
> Pls help me, thanks a lot.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: response view with markdown

2017-10-18 Thread Massimo Di Pierro
Just create a generic view that does it. It is a good exercise.

On Tuesday, 17 October 2017 16:29:24 UTC-5, 黄祥 wrote:
>
> why web2py can't render the views in markdown format that been assign 
> (*.md) in most simple way?
> e.g.
> def testmd():
> response.view = 'default/testmd.md'
> #response.render = 'default/testmd.md'
> return locals()
>
> think about github pages can render it 
>
> thanks and 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.


[web2py] Re: Cant access Google Cloud SQL on GAE application

2017-10-18 Thread Massimo Di Pierro
I use mysql on google app engine all the time. I use mysqldb with latest 
web2py and dal without any issue.

That is not the right connection string. It should be more something like 
this:

google:MySQLdb://username:password@/dbname?unix_socket=/cloudsql/projectname
:us-central1:dbinstanceid


On Friday, 13 October 2017 00:01:12 UTC-5, Bernardo Leon wrote:
>
> Hello, me again. I am testing Google Cloud Platform along with pycharm (I 
> added a new run configuration for gae inside pycharm) and I have the 
> following model:
>
> # -*- coding: utf-8 -*-
> from gluon.tools import Auth
>
> db = DAL('google:sql://trahello:trahello-db/trahello')
>
> I have installed the google app engine local server and did their hello 
> world tutorial so I think my installation is fine.
>
> When I hit the run button my console gives no errors:
>
> INFO 2017-10-13 04:40:50,304 sdk_update_checker.py:231] Checking for 
> updates to the SDK.
> INFO 2017-10-13 04:40:51,108 sdk_update_checker.py:259] The SDK is up 
> to date.
> INFO 2017-10-13 04:41:03,088 api_server.py:300] Starting API server 
> at: http://localhost:36575
> INFO 2017-10-13 04:41:03,146 dispatcher.py:251] Starting module 
> "default" running at: http://127.0.0.1:8080
> INFO 2017-10-13 04:41:03,147 admin_server.py:116] Starting admin 
> server at: http://localhost:8000
>
> but when I try to open my app url: http://localhost:8080/trahello I get 
> the following error.
>
> Traceback (most recent call last):
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/restricted.py", 
> line 219, in restricted
> exec(ccode, environment)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/applications/trahello/models/modelo.py",
>  
> line 4, in 
> db = DAL('google:sql://trahello:trahello-db/trahello')
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/base.py",
>  
> line 170, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/base.py",
>  
> line 475, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/base.py",
>  
> line 455, in __init__
> self._adapter = adapter(**kwargs)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>  
> line 40, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  
> line 368, in __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  
> line 50, in __init__
> self._initialize_(do_connect)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/adapters/google.py",
>  
> line 32, in _initialize_
> super(GoogleSQL, self)._initialize_(do_connect)
>   File 
> "/home/bernardo/PycharmProjects/w2p_trahello/web2py/gluon/packages/dal/pydal/adapters/mysql.py",
>  
> line 24, in _initialize_
> user = self.credential_decoder(m.group('user'))
> IndexError: no such group
>
> Since the google adapter inherits from MySQL adapter it tries to run the 
> _initialize_ method of the MySQL adapter which in turn tries to get the 
> user and the password from the Google SQL URI. Is this an expected 
> behaviour? 
>
> How good is the Google Cloud Platform support on web2py? I am using the 
> most recent stable version: Version 
> 2.15.4-stable+timestamp.2017.09.02.04.02.22
>
> Thank you for any insight!
>

-- 
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 won't start with getLogger error

2017-10-18 Thread Massimo Di Pierro
All I can offer is help you debug. Are you still in Chicago? Stop by my 
office on Tuesday afternoon.


On Friday, 6 October 2017 18:32:51 UTC-5, Omi Chiba wrote:
>
> My Python version is 2.7.4. and My Web2py is Version 
> 2.4.7-stable+timestamp.2013.05.24.17.48.47
>
> Nothing changed since I setup my server in 2013 but it looks like 
> something happened at 10/2 per error log. Remote Access to the server was 
> down. My hosting company told me they did some kind of update and working 
> fine now but my web2py doesn't work...
>
>
> On Friday, October 6, 2017 at 5:26:14 PM UTC-5, Omi Chiba wrote:
>>
>> Help!
>>
>> I was running old version (2015) of web2py on my hosting server as our 
>> company's portal site and it stopped working suddenly. It's Windows 2012 
>> server with Uniserver(Apache). Apache start fine but shows error message. 
>>
>> http://thksupport.com
>>
>>
>> Here's some related files including error log.
>>
>> https://drive.google.com/drive/folders/0B3I1Y31Dk4GqTjRSZHFEWlU0Mk0?usp=sharing
>>
>> I also tried if I can just start up web2py with rocket server by excuting 
>> web2py.py but I got a following error. I really don't know what to do... 
>> this is production server for our customer and need to be fixed as soon as 
>> possible.I restored the entire folder for Uniserver and web2py but same 
>> error. 
>>
>> C:\web2py>web2py.py
>> Traceback (most recent call last):
>>   File "C:\web2py\web2py.py", line 18, in 
>> import gluon.widget
>>   File "C:\web2py\gluon\__init__.py", line 15, in 
>> from globals import current
>>   File "C:\web2py\gluon\globals.py", line 17, in 
>> from storage import Storage, List
>>   File "C:\web2py\gluon\storage.py", line 16, in 
>> import portalocker
>>   File "C:\web2py\gluon\portalocker.py", line 46, in 
>> logger = logging.getLogger("web2py")
>> AttributeError: 'module' object has no attribute 'getLogger'
>>
>

-- 
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: Why web2py server hangs/freeze?

2017-10-11 Thread Massimo Di Pierro
we stopped recommending and supporting apache long ago. The world has moved 
to nginx and so have we.
these problems are apache problems not web2py problems and that is why we 
stopped supporting it.

On Friday, 15 September 2017 00:40:46 UTC-5, Narendra Kumar wrote:
>
> Hi,
>
> As suggested in previous posts, I deploy my web2py application on apache 
> sever. I use scripts/setup-web2py-debian-sid.sh file to make setup on local 
> server, which exists in web2py folder and follow steps defined on URL 
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#One-step-production-deployment
> .
> But Still I get the server down issue.
>
>
> Regards
> Narendra
>
>
> On Monday, September 4, 2017 at 7:17:25 PM UTC+5:30, Narendra Kumar wrote:
>>
>> Hi,
>>
>> I stuck on the problem, as web2py server freezes/hang frequently. Almost 
>> daily. 
>> I tried to track the reason, but I did not get any possible reason. 
>> Because I think this happen due to large amount of data processing and 
>> create file with large data or try to download big files. But later I found 
>> that It freezes/hangs any time.
>>
>> Please help me.
>>
>> Regards
>> Narendra Kumar
>>
>

-- 
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 won't start with getLogger error

2017-10-11 Thread Massimo Di Pierro
This is what I get:

Python 2.7.13 |Anaconda 2.2.0 (x86_64)| (default, Dec 20 2016, 23:05:08) 

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

Anaconda is brought to you by Continuum Analytics.

Please check out: http://continuum.io/thanks and https://anaconda.org

>>> import logging

>>> import platform

>>> logger = logging.getLogger("web2py")


python 2.7.4 is 4 years old. I suspect they installed a "logging" module 
that conflicts with the standard logging one. This is not a web2py issue.

On Friday, 6 October 2017 19:20:00 UTC-5, Omi Chiba wrote:
>
> But I realized the same error happen when I follow the code in python 
> console... I don't understand because nothing changed python, web2py... 
> since 2013.
>
> C:\>python
> Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] 
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import logging
> >>> import platform
> >>> logger = logging.getLogger("web2py")
> Traceback (most recent call last):
>   File "", line 1, in 
> AttributeError: 'module' object has no attribute 'getLogger'
> >>>
>
> On Friday, October 6, 2017 at 6:54:53 PM UTC-5, Omi Chiba wrote:
>>
>> Python comand console? 
>>
>> Yes, it looks ok I think.
>> http://prntscr.com/gu94ns
>>
>> On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote:
>>>
>>>
>>>
>>> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote:

 I have C:\Python27 in my "Path" System variables and I can run the 
 pyson module (*.py) from command prompt.

>>>
>>>
>>> can you, at that prompt, do 
>>> import logging
>>> dir(logging)
>>>
>>>
>>>
>>> ?
>>>
>>> /dps
>>>  
>>>

 On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote:
>
>
>
> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote:
>>>
>>> Help!
>>>
>>> I was running old version (2015) of web2py on my hosting server as 
>>> our company's portal site and it stopped working suddenly. It's Windows 
>>> 2012 server with Uniserver(Apache). Apache start fine but shows error 
>>> message. 
>>> [...] 
>>>
>> AttributeError: 'module' object has no attribute 'getLogger'
>>>
>>
>>
>>
>> The logging module is standard python for 2.7 and earlier ... what 
>> version of python are you using, and has that changed recently?
>>
>>
> Or did your PYTHONPATH variable change.
>
> import logging
> dir(logging)
>
>
>
> shows getLogger in python 3.6.2, also.
>
> /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] Re: MySql encryption using DAL

2017-10-11 Thread Massimo Di Pierro


On Saturday, 7 October 2017 01:55:53 UTC-5, appjar...@gmail.com wrote:
>
> Thank you Massimo!
>
> There is a great detailed deployment recipe for SSH tunneling to your 
> database server from a Heroku app instance (dyno). It works as of this 
> post.10/8/17
>
> https://stackoverflow.com/questions/21575582/ssh-tunneling-from-heroku/46629121#46629121
>
> There are 2 issues/questions with this though:
>
> 1) So now that I can tunnel in, I have a performance question:  Since the 
> mysql database server will be making all of its connections to localhost is 
> that a single connection rather than multiple?  Will I lose database read 
> concurrency?  If so, will either that or the SSH tunnels be a bottleneck 
> and severely degrade my database performance?
>

web2py has connection pooling. Each of connection from the pool will go 
through the tunnel, concurrently up to the max number in the pool.

>
> 2) SSH tends to be flaky and drop connections leaving a broken Web2py app 
> instance.  Any suggestions on best practices for handling that case?
>


No. Sorry. If others have suggestions I would like to hear them.
 

>
> It's too bad DAL doesn't support secure connections.  Encrypted database 
> connections are pretty standard nowadays and I see there are python mysql 
> connectors that do. Has anyone successfully swapped out the one that ships 
> with one of those?
>

It would be easy to add. we will work in it.
 

>
> Cloud deployment is new to me so I really appreciate the help, and I love 
> using Web2py so thanks for making it and the ongoing support! 
>
>

-- 
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 won't start with getLogger error

2017-10-06 Thread Massimo Di Pierro
The file in question no longer exists. It has been moved to a subfolder 
long ago. 
The error you are getting makes no sense since 

python

>>> import logging

>>> logging.getLogger



 that is a function from the python module logging, and not a web2py 
function.

to diagnose this it is important to understand:
which python version?
what has changed?


On Friday, 6 October 2017 17:26:14 UTC-5, Omi Chiba wrote:
>
> Help!
>
> I was running old version (2015) of web2py on my hosting server as our 
> company's portal site and it stopped working suddenly. It's Windows 2012 
> server with Uniserver(Apache). Apache start fine but shows error message. 
>
> http://thksupport.com
>
>
> Here's some related files including error log.
>
> https://drive.google.com/drive/folders/0B3I1Y31Dk4GqTjRSZHFEWlU0Mk0?usp=sharing
>
> I also tried if I can just start up web2py with rocket server by excuting 
> web2py.py but I got a following error. I really don't know what to do... 
> this is production server for our customer and need to be fixed as soon as 
> possible.I restored the entire folder for Uniserver and web2py but same 
> error. 
>
> C:\web2py>web2py.py
> Traceback (most recent call last):
>   File "C:\web2py\web2py.py", line 18, in 
> import gluon.widget
>   File "C:\web2py\gluon\__init__.py", line 15, in 
> from globals import current
>   File "C:\web2py\gluon\globals.py", line 17, in 
> from storage import Storage, List
>   File "C:\web2py\gluon\storage.py", line 16, in 
> import portalocker
>   File "C:\web2py\gluon\portalocker.py", line 46, in 
> logger = logging.getLogger("web2py")
> AttributeError: 'module' object has no attribute 'getLogger'
>

-- 
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: MySql encryption using DAL

2017-10-06 Thread Massimo Di Pierro
DAL does not provide https encryption. I do not if the adapters support it 
either.

The solution is to create a SSH tunnel between the server and the database 
server and the use a URI string connecting to localhost.

On Thursday, 5 October 2017 14:21:22 UTC-5, appjar...@gmail.com wrote:
>
> Hello,
>
> I have a Web2py app I'm moving from a dedicated server to the cloud but 
> I'm leaving my MySQL database on the original server. 
>
> I am connecting to mysql via the DAL:
> db = DAL('mysql://username:passw...@db.example.com/', pool_size=8, 
> migrate = migrate_dev, lazy_tables=True, fake_migrate=True)
>
> I can't find any examples though on how to make this connection secure as 
> it goes across the public internet.  Can someone point me at the code need 
> on both the Web2py app and MySql server ends to make that happen?
>
> Thank you so much,
> -Mike
>
>

-- 
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: Google AMP - benefits with web2py?

2017-10-06 Thread Massimo Di Pierro
The fact is the world is changing. these days people should be use webpack 
and that requires node.js therefore we I think web2py should stick to what 
it does best and stay out of css/jss for now.

-- 
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: 2.15.4 web2py.js

2017-10-06 Thread Massimo Di Pierro
This is a mistake. Will be fixed.

On Monday, 2 October 2017 14:06:32 UTC-5, Dave S wrote:
>
> Just getting ready to try out 2.15.4, and BeyondCompare tells me that 
> applications/welcome/static/js/web2py.js changed,
> but the same file for examples and admin did not.  If this is deliberate, 
> is it documented?
>
> /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] Re: component rebuild via anchor helper

2017-10-06 Thread Massimo Di Pierro
You can do, but it feels wrong.

linked page


On Monday, 2 October 2017 06:47:14 UTC-5, Pierre wrote:
>
> hello all,
>
> I am using the A helper as described in the book to reconstruct a page 
> component when user presses a button:
>
> {{=A('linked page', _href=URL('func', vars={'a':a, 'b':b}), cid='myid')}} 
> 
>
> query string I pass can be quite long so I'd like a POST request instead of a 
> GET.
> Is this possible keeping the same technique ?
>
>

-- 
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: Python3 and uwsgi

2017-09-30 Thread Massimo Di Pierro
Can you help?

On Wednesday, 23 August 2017 18:33:08 UTC-5, Leonel Câmara wrote:
>
> wsgibase in gluon/main.py probably needs a few to_bytes calls
>

-- 
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: login strange( or not ) behaviour http/https

2017-09-30 Thread Massimo Di Pierro
This is a basic security requirement to prevent information leakage.
https://www.owasp.org/index.php/Session_Management_Cheat_Sheet
"Web applications should never switch a given session from HTTP to HTTPS, 
or viceversa, as this will disclose the session ID in the clear through the 
network."

web2py did this for years and it is disgraceful other more popular 
frameworks do not.

Massimo

On Thursday, 28 September 2017 11:41:10 UTC-5, Ramos wrote:
>
> Hello i noticed that if i logged via https and then try to change the url 
> to http i have to log again but  until i go back to https and logout i 
> cannot login with the other protocol.
>
> The reverse is also true from http to https.
>
>
> Is this a web2py thing ?
>
>
> Regard
>
>

-- 
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: Future releases and support

2017-09-30 Thread Massimo Di Pierro
Can you provide a few examples of things you can find howto for Flask and 
not for web2py? I am curious.

On Wednesday, 27 September 2017 17:13:59 UTC-5, greenpoise wrote:
>
> To me and this is my opinion only, I have followed web2py for as long as I 
> can remember. The difference between web2py and flask or even web2py and 
> ruby (just to name another framework/language) is that web2py examples are 
> outdated and very limited. I am able to find more updated tutorials on 
> flask or ruby than what I am able to find for web2py. Even Pyramid goes 
> deeper. Digging into this group is a chore and a very frustrating one. So 
> if you ask me, where do you go from here if the code is solid and quite 
> complex, Documentation period. Give me examples that can be used in todays 
> world,  that look nice and feel nice. So that means examples that include 
> all the bell and whistles that make an application look and feel nice. 
> Provide a good solid tutorial/example on SaaS from the ground up and you 
> got my fair share. I dont mind paying for documentation/tutorials/udemy 
> whatever but give the users a full scope within one place and to be honest, 
> we are talking about a tutorial that is complementary to the manual that it 
> is in place. Is not like destroying the manual that it is in place. Just an 
> addition. Charge for it, I'll buy it just like I did the first few versions 
> of the documentation. I really like web2py but every time I comeback to 
> build something, I have to look for hours on how to do that one thing. 
>
>
> just my 2 cents.
>
>
> cheers
>
>
> On Wednesday, September 20, 2017 at 10:18:14 PM UTC-7, Massimo Di Pierro 
> wrote:
>>
>> I second what Anthony said. There are less commits because the code is 
>> solid and grew up to be quite complex. Also we are thinking about where to 
>> go from here.
>>
>> On Monday, 11 September 2017 06:48:50 UTC-5, Anthony wrote:
>>>
>>> On Monday, September 11, 2017 at 2:46:17 AM UTC-4, Arnab Dutta wrote:
>>>>
>>>> Thanks Anthony, just what I wanted to know whether the framework and 
>>>> community is still active as I am building some internal tools for my 
>>>> company on web2py. Most of te tutorials and documents were from 2016 and 
>>>> before so wasn't sure how active the framework was when compared to te 
>>>> likes of Django/Flask and Tornado.
>>>
>>>
>>> web2py is fairly mature, so development is perhaps a little less active 
>>> than it used to be, but commits are still being made consistently, 
>>> documentation is being updated, and in terms of support, this Google Group 
>>> continues to be very active.
>>>
>>> Anthony
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Broken backwards compatibility: Using a field in multiple tables yields error

2017-09-30 Thread Massimo Di Pierro
Thanks for reporting this. We will fix this in 2.15.5 shortly.

On Monday, 25 September 2017 11:38:51 UTC-5, Jordan Myers wrote:
>
> I have many tables that share common attributes, so for convenience and 
> ease of refactoring, I decided to define such common fields and then simply 
> reference those fields when defining tables. For example: 
>
> namefield = Field("name")
> db.define_table('table1', namefield)
> db.define_table('table2', namefield)
>
>
>
> This works correctly on 2.14.6 but somewhere along the way to version 
> 2.15.4 something changed such that the above code yields the error "Field 
> table1.name is already bound to a table" This is probably due to 
> upgrading to a new PyDAL version. It looks like I'll have to refactor to 
> use table inheritance or the .clone() method. Just leaving this here in 
> case others find the same error.
>

-- 
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: Kaspersky problem with web2pyslices.com

2017-09-30 Thread Massimo Di Pierro
LOL. May be the certificate is expired or self signed? I am not sure 
web2pyslices is really maintained at this time. There are talks of a 
revamp

On Saturday, 23 September 2017 15:05:53 UTC-5, Leonel Câmara wrote:
>
> Uninstalling kaspersky solves this problem.
>

-- 
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: Cassandra and web2py

2017-09-30 Thread Massimo Di Pierro
You have

db = cluster.connect('mykeyspace')

which means that for you db is not a DAL() object but a Cassandra 
connection. You the pass it to

auth = Auth(db)

but here Auth(...) expects a DAL() object.

On Friday, 22 September 2017 20:18:28 UTC-5, 黄祥 wrote:
>
> tryin to use cassandra with web2py using cassandra-driver but return an 
> error:
> e.g.
> *cassandra side*
> pip install cassandra-driver
> systemctl restart cassandra
> cqlsh
>
> cqlsh> show version
> [cqlsh 5.0.1 | Cassandra 3.11.0 | CQL spec 3.4.4 | Native protocol v4]
> cqlsh> CREATE KEYSPACE mykeyspace WITH replication = {'class': 
> 'SimpleStrategy', 'replication_factor': 1};
>
> *web2py side version 2.15.4*
> create new web2py app
> *models/db.py*
> if not request.env.web2py_runtime_gae:
> from cassandra.cluster import Cluster
> cluster = Cluster(['127.0.0.1'] )
> db = cluster.connect('mykeyspace')
>
> *error:*
> Traceback (most recent call last):
>   File "/home/site/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/home/site/web2py/applications/a/models/db.py", line 73, in 
> 
> auth.define_tables(username=False, signature=False)
>   File "/home/site/web2py/gluon/tools.py", line 2210, in define_tables
> migrate = db._migrate
> AttributeError: 'NoneType' object has no attribute '_migrate'
>
> any wayout to face this?
>
> thanks and 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] Re: Support for BIT(1) as boolean?

2017-09-30 Thread Massimo Di Pierro
I have seen that I am trying to get to the bottom of that. The string 
"NO_AUTO_CREATE_USER" 
does not appear in web2py, in dal, nor in rocket. My guess is that the 
error is caused by mysqldb. Do you agree?

On Friday, 15 September 2017 17:40:07 UTC-5, Yan Wong wrote:
>
>
>
> On Monday, 11 September 2017 00:08:00 UTC+1, Massimo Di Pierro wrote:
>>
>> what adapter are you using. What is your URI string (without passwords 
>> please)?
>>
>
> By the way, starting web2py using Rocket now says 
> /usr/local/lib/python2.7/site-packages/pymysql/cursors.py:166: 
> Warning: (3090, u"Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. 
> It will be removed in a future release."), but I guess you know that.
>

-- 
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: checkbox don't appear

2017-09-30 Thread Massimo Di Pierro
No idea. Use the chrome inspector and look if it is a css issue. The html 
for the checkboxes should be there.

On Thursday, 21 September 2017 05:56:16 UTC-5, Lars wrote:
>
> Hi,
>
> I want to display a form with the following code :
>
> def display_line():
> T = current.T
> try:
> return TR(
> TD(id),
> TD(file_name),
> TD(file_size),
> TD(file_type),
> TD(INPUT(_type='submit', _name=T('Rename'), _value=T('Rename'
> ))),
> TD(INPUT(_type='submit', _name=T('Delete'), _value=T('Delete'
> ))),
> TD(INPUT(_type='submit', _name=T('Details'), _value=T(
> 'Details'))),
> TD(INPUT(_type='checkbox', _value=id))
> )
> except (AttributeError, KeyError):
> return
>
>
> def get_filesystem_form():
> T = current.T
> files_html = []
>
> # get files list
> file_list = files.load()
>
> for _file in file_list:
> files_html.append(display_line(_file))
> return FORM(TABLE(*files_html), _width='100%')
>
>
>
>
> And everything looks fine except that checkboxes don't appear.
>
> Any idea ?
>
> w2p : 2.15.4 python : 3.5.3
>
>
>

-- 
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: Build query without DB connection

2017-09-20 Thread Massimo Di Pierro
In web2py, and in general in code that runs multithreaded you should not 
define variables in modules at top level and then import them because they 
are cached and then shared by multiple threads. That is not thread safe and 
will cause all kind of problems. Modules should define functions and 
classes, not objects. You should only import those functions and classes. 

On Wednesday, 20 September 2017 02:25:14 UTC-5, Brendan Barnwell wrote:
>
> It seems that the "db" object given by the DAL wraps up not only the 
> database definition, but also a "live" connection to the database.  This 
> means that if the db object is stashed somewhere, it can go "stale" and 
> attempts to use it later will lead to strange errors.  Is that so?
>
> What I'm trying to do is to pre-build a query constraint like 
> "db.MyTable.myfield < 2", within a module.  Later in controller code I may 
> retrieve these stored constraints and string them together using &.  But 
> right now it seems I have to build the constraints anew within a function, 
> because if I do something like "stored_query = db.MyTable.myfield < 2" at 
> the top level of module code, the db object goes stale.  Later I get errors 
> such as "name conflict in table list", apparently because it doesn't 
> realize the stored "db.MyTable" is the same as "real_db.MyTable" (where 
> "real_db" is the new live db object for the current request).
>
> It is not a huge deal to regenerate the constraints by calling a function, 
> but it would be nice if they could just be stored as static objects.  Is 
> there any way to use the DAL's nice query-building syntax without a live DB 
> connection, and then later used one or more stored query constraints when 
> querying a live db connection?  Something like:
>
> # in somemodule.py
> db = ? # get non-live DB object to build query
> query1 = db.MyTable.myfield < 2
> query2 = db.MyTable.otherfield == "blah"
>
> # in a controller
> import somemodule
>
> def controller_function():
> # now db has a live connection
> db(somemodule.query1 & somemodule.query2).select()
>
> Is such a thing possible?
>

-- 
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: Future releases and support

2017-09-20 Thread Massimo Di Pierro
I second what Anthony said. There are less commits because the code is 
solid and grew up to be quite complex. Also we are thinking about where to 
go from here.

On Monday, 11 September 2017 06:48:50 UTC-5, Anthony wrote:
>
> On Monday, September 11, 2017 at 2:46:17 AM UTC-4, Arnab Dutta wrote:
>>
>> Thanks Anthony, just what I wanted to know whether the framework and 
>> community is still active as I am building some internal tools for my 
>> company on web2py. Most of te tutorials and documents were from 2016 and 
>> before so wasn't sure how active the framework was when compared to te 
>> likes of Django/Flask and Tornado.
>
>
> web2py is fairly mature, so development is perhaps a little less active 
> than it used to be, but commits are still being made consistently, 
> documentation is being updated, and in terms of support, this Google Group 
> continues to be very active.
>
> 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: dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-10 Thread Massimo Di Pierro
you can 

delete session['anyvar']

or 

session.anybar = None

it will be saved this purging anyvar.



On Thursday, 7 September 2017 16:29:03 UTC-5, CDA wrote:
>
> Can we purge only a subset of sessions?
>
> On Sep 7, 2017 5:17 PM, "Anthony"  wrote:
>
>> On Thursday, September 7, 2017 at 1:18:10 PM UTC-4, Alex Glaros wrote:
>>>
>>> is it theoretically possible to leverage redis as a sessions store so 
>>> that web2py session can hold many of the things normally kept on the db?
>>>
>>> For example, could you store things like email-contacts and high-use 
>>> lookup tables usually accessed as tables on the db, but now in session vars 
>>> in order to reduce hits to the db?  (Db would only be accessed if there was 
>>> any change to the tables represented by session vars.)
>>>
>>
>> Keep in mind that the session is specific to each user, so you would only 
>> want to store data unique to each user. If you simply want to cache common 
>> database queries (that are not user specific), you can use the web2py cache 
>> system (including the DAL functionality to cache selects 
>> ).
>>  
>> You can use Redis for caching as well as for sessions: 
>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Caching-with-Redis
>> .
>>
>> 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: how to import a package that has deeply nested imports

2017-09-10 Thread Massimo Di Pierro
Thanks for letting us know. That usually works. When it does not the you 
can use the web2py/site-packages folder.

On Tuesday, 5 September 2017 07:26:35 UTC-5, Carl Hunter Roach wrote:
>
> placing the tlslite directly in applications/appname/modules enables 
> import statements to resolve correctly (just as the manual states! :)
> I had incorrectly placed it one level lower to group some other files 
> together.
>
>
> On Monday, 4 September 2017 18:28:48 UTC+1, Carl Hunter Roach wrote:
>>
>> I'd like to use 
>> https://github.com/freshplanet/AppEngine-SocketPool/tree/master/tlslite 
>> in a GAE/Web2py project
>>
>> If I place tlslite in my apps `modules` directory I can then add imports 
>> such as `from applications.appname.modules.tlslite import ...`
>>
>> but tlslite's python source has many `import` statements.
>>
>> do I need to change each `import` statement to include the path 
>> `applications.appname.modules. etc` ?
>>
>>

-- 
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: Why web2py server hangs/freeze?

2017-09-10 Thread Massimo Di Pierro
Let's rule out the usual culprits:

- when you saying it hangs are your trying from a new incognito window or 
from the same browser? It may be a session lock not a freeze.
- are using apache? Don't it has memory issues. Use Nginx
- do you have processes that may take a lot of time? consider adding 
session.forget() at the beginning of those actions and/or move the 
computation to a background task
- are you using sqlite? It does serialize all writes and locks the DB in 
the process. Have you tried postgresql?
- if you are using postgresql, have you checked the database logs? 

Massimo


On Monday, 4 September 2017 08:47:25 UTC-5, Narendra Kumar wrote:
>
> Hi,
>
> I stuck on the problem, as web2py server freezes/hang frequently. Almost 
> daily. 
> I tried to track the reason, but I did not get any possible reason. 
> Because I think this happen due to large amount of data processing and 
> create file with large data or try to download big files. But later I found 
> that It freezes/hangs any time.
>
> Please help me.
>
> Regards
> Narendra Kumar
>

-- 
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: how to pass table name to controller?

2017-09-10 Thread Massimo Di Pierro
I think you want:

tablename, fieldname = specificTableToSearchMembersFromID.split('.')
db.Role.object_super_object_FK.requires = IS_IN_DB(db 
(db[tablename][fieldname]), 
'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose 
one'))

On Friday, 1 September 2017 16:36:10 UTC-5, Alex Glaros wrote:
>
> this works
>
> db.Role.object_super_object_FK.requires = IS_IN_DB(db (
> db.cost_center.id), 'cost_center.super_object_fk', 
> '%(cost_center_title)s', zero = T('choose one'))
>
> but when I try to pass the table name as a var, it doesn't understand the 
> var
>
> specificTableToSearchMembersFromID = 'cost_center.id'
> db.Role.object_super_object_FK.requires = IS_IN_DB(db ([
> specificTableToSearchMembersFromID]), 'cost_center.super_object_fk', 
> '%(cost_center_title)s', zero = T('choose one'))
>
>  'DAL' object has no attribute '
> db.cost_center.id'
>
> thanks
>
> Alex Glaros
>

-- 
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: Support for BIT(1) as boolean?

2017-09-10 Thread Massimo Di Pierro
what adapter are you using. What is your URI string (without passwords 
please)?

On Monday, 4 September 2017 09:53:46 UTC-5, Yan Wong wrote:
>
> With this code, I now find that with the latest version of web2py 
> (2.15.4), I get 
>
> File "applications/XXX/models/db.py", line 46, in 
> db._adapter.types = copy.copy(db._adapter.types)
> AttributeError: can't set attribute
>
> I have deleted the copy.copy line, so that I am modifying the adapter 
> straight away. I guess this is OK? Could someone confirm?
>
> Cheers
>
> Yan
>
> On Tuesday, 12 January 2016 19:56:13 UTC, Alfonso Serra wrote:
>>
>> Excuse me, one last question.
>>
>> Is it really necesary? 
>> import copy
>> db._adapter.types = copy.copy(db._adapter.types)
>>
>> or modify the adapter right away will work? It looks like it does, but i 
>> dont know if theres any implication by skiping copy.
>>
>> 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: back button

2017-09-10 Thread Massimo Di Pierro
You cannot add buttons to a readonly crud form because it has no button 
row. You can do:

form.components.append(A('Back',_onclick="window.history.go('-1')"))


On Sunday, 3 September 2017 13:49:31 UTC-5, Andrea Fae' wrote:
>
> I use in a  method this 
> form=crud.read(db.evento,evento)
>
> and the html vies is very simple
>
> {{extend 'layout.html'}}
> Evento
> {{=form}}
>
>
> how to add a simple button to go back in the previous page? I tried 
> form.add_button('Back', URL('index'))
>
> but I have this error
>  'NoneType' object has no attribute 
> 'parent'
>
> 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: web2py 2.15.4 is OUT

2017-09-03 Thread Massimo Di Pierro
Can you try again? Should be fixed.

On Sunday, 3 September 2017 11:54:48 UTC-5, Massimo Di Pierro wrote:
>
> very strange. Looking into this.
>
> On Saturday, 2 September 2017 11:33:00 UTC-5, dome wrote:
>>
>> Dear Massimo
>>
>> The new windows executable 
>>
>> 2.15.4-stable+timestamp.2017.09.02.04.02.22 ( 
>> <http://www.web2py.com/init/default/download>LGPLv3 License 
>> <http://www.gnu.org/licenses/lgpl.html>)
>>
>> is identical to the 2.15.2.
>>  
>> Already reported the same for 2.15.3:
>>
>>>
>>> https://groups.google.com/forum/?fromgroups#!topic/web2py/IdlH3hc8bRk
>>>
>>
>> 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: web2py 2.15.4 is OUT

2017-09-03 Thread Massimo Di Pierro
very strange. Looking into this.

On Saturday, 2 September 2017 11:33:00 UTC-5, dome wrote:
>
> Dear Massimo
>
> The new windows executable 
>
> 2.15.4-stable+timestamp.2017.09.02.04.02.22 ( 
> LGPLv3 License 
> )
>
> is identical to the 2.15.2.
>  
> Already reported the same for 2.15.3:
>
>>
>> https://groups.google.com/forum/?fromgroups#!topic/web2py/IdlH3hc8bRk
>>
>
> 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] web2py book links and Dropbox

2017-09-03 Thread Massimo Di Pierro
Dear Web2py users,

the link to the book is broken and you can find the new (temporary) link to 
the book here: 
https://www.dropbox.com/s/fuik35ayg686de3/web2py_manual_5th.pdf?dl=0

One the one side there is an easy fix to a broken link, replace all 
references to the new URL.
Yet the problem is bigger and I am very upset.

I use Dropbox and Dropbox has a public folder. Everything in this folder 
had a public direct link. I keep the web2py book there along with talks, 
code, etc. and a lot of material I have shared with you over the years, 
with my students, and collaborators. These links have been published in 
various places outside my control.

Dropbox has decided to drop support for a default public folder since 
September 1, and required that I share it explicitly. I tried that and to 
my surprise two bad things happened:
- the new links are different than the original links so they are broken 
anyway
- the content of the folder becomes searchable and I do not want that. I 
wanted direct links to the content but I do not want everybody to see 
everything.

I emailed them but looks like they have made their mind. Although they 
provide a solution to sharing they do not provide a solution to the broken 
links to previously shared content. I have been a long term fanboy of 
Dropbox but they made a huge mistake and I will probably be moving all my 
files somewhere else. This issue is bigger than the link to the web2py 
book. 

When I find a new reliable home for my public files, I will replace the 
link in the web2py repo.
I apologize for the inconvenience.

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.


[web2py] Re: Web2py + PhoneGap + Cordova (Mobile Developer)

2017-09-02 Thread Massimo Di Pierro
I am very much interested in this. Can you tell us more about your goals. 
Also, can you email me privately?

On Saturday, 2 September 2017 01:03:20 UTC-5, Junior Phanter wrote:
>
> Hi guys...
> I'm starting a project (web2py plugin) to help in the development of 
> mobile applications with web2py (backend server), Phonegap (Support Server 
> for development) and Cordova (samples and build).
> Here is the repository:
>
> https://github.com/PhanterJR/PhanterMobileConstructor
>
> Who can test and give me feedback would appreciate ...
> Remembering that I have not yet finished, I tested only on Windows 8 and 
> 10, I still want to add some features, for now it's very simple ...
> As it is I can do a lot, but I want to mature the idea ...
> At least I avoid getting my hands dirty with Java. Lol
>

-- 
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: mercurial

2017-09-01 Thread Massimo Di Pierro
There is an advantage in having some minimal version control functionality 
available through the web admin.
We just have the wrong functionality. 

What we need is commit, push, and pull only. In that an admin can upgrade 
an app by pressing a button in admin, without having to login.

On Thursday, 31 August 2017 21:06:25 UTC-5, Dave S wrote:
>
>
>
> On Thursday, August 31, 2017 at 3:26:43 PM UTC-7, Massimo Di Pierro wrote:
>>
>> I think we should drop mercurial support and move to git consistently.
>>
>
> Perhaps drop all VCS built-ins, and let the role be better served by VCS 
> tools external to the web2py code.
>
> /dps
>
>
>> On Wednesday, 30 August 2017 06:21:13 UTC-5, mweissen wrote:
>>>
>>> I want to try the admin versioning.
>>> mercurial is installed, hg --version shows 2.8.2
>>>
>>> And a click on versioning gives "Sorry, could not find mercurial 
>>> installed"
>>>
>>> What is wrong - any ideas?
>>> Regards, Martin
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Best practice regarding applications

2017-09-01 Thread Massimo Di Pierro
It is fine to have one web2py and as many domains as you need. It should 
not affect performance provided you take advantage of the cores you have. 
That means you want to make sure you use nginx+uwsgi or gevent or gunicorn 
and have about one process per core.

On Friday, 1 September 2017 05:17:42 UTC-5, Najtsirk wrote:
>
> Hello,
>
> after a long years of active use of web2py it came to me that probably I 
> am not doing it as it should! :)
>
> So within one web2py i have several applications and each one is acctualy 
> a separate site ona a different domain. Is this best pracitce or should i 
> have one web2py instance for every site and applications are just 
> functional subsections of the particular site?
>
> What is the performance impact of one way over the other (if any)?
>
> Thanks for your answers.
>
> Kristjan
>

-- 
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] web2py 2.15.4 is OUT

2017-09-01 Thread Massimo Di Pierro
Includes a few bug-fixes (thanks to Anthony and Leonel in particular) and 
it is tracking the latest python (thanks Giovanni).

Please report any outstanding problem so we can continue make web2py better.

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.


[web2py] Re: mercurial

2017-08-31 Thread Massimo Di Pierro
I think we should drop mercurial support and move to git consistently.

On Wednesday, 30 August 2017 06:21:13 UTC-5, mweissen wrote:
>
> I want to try the admin versioning.
> mercurial is installed, hg --version shows 2.8.2
>
> And a click on versioning gives "Sorry, could not find mercurial installed"
>
> What is wrong - any ideas?
> Regards, Martin
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Link to 2.15.3 downloads 2.15.2

2017-08-31 Thread Massimo Di Pierro
very strange. Will repush a new version. May fix this. let me know if 
problem persists after tomorrow.

On Thursday, 31 August 2017 04:17:33 UTC-5, icodk wrote:
>
> On http://www.web2py.com/ there is a link to the download area:
> 2.15.3-stable+timestamp.2017.08.07.12.51.45 ( 
> LGPLv3 License 
> )
> However, clicking on the   For Windows button under the For normal users , 
> downloads 2.15.2
>
> (https://mdipierro.pythonanywhere.com/examples/static/web2py_win.zip)
>
>

-- 
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: Small correction to the manual

2017-08-31 Thread Massimo Di Pierro
good catch. Thanks. Can you try submit a patch to the book in git?

On Wednesday, 30 August 2017 09:57:04 UTC-5, Paul Furber wrote:
>
> In this section of the manual: 
> http://www.web2py.com/books/default/chapter/29/10/services#parse_as_rest--experimental-
>
> There is a paragraph explaining how to use cURL to test a restful API as 
> follows:
>
> If you have the "curl" utility installed you can try:
>
> $ curl -d "name=Tim" http://127.0.0.1:8000/myapp/default/api/friend.json
> {"errors": {}, "id": 1}
>
>
> ---
> That example (it's the first one) won't work because the code for POST 
> above doesn't do any pattern matching. It should be:
>
> $ curl -d "name=Tim" http://127.0.0.1:8000/myapp/default/api/person.json
> {"errors": {}, "id": 1}
>
> so it passes the table name directly. 
>
>
>

-- 
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: Ingres with web2py

2017-08-31 Thread Massimo Di Pierro
Honestly. Support for ingres was added long ago and it did work. then pydal 
was rewritten to be more modular and I do not now believe anybody has 
tested ingres since that rewrite. If you want to help we can setup chat 
time and run some tests together and see whether there is any problem.

Massimo

On Wednesday, 30 August 2017 09:56:53 UTC-5, jimsmith13...@gmail.com wrote:
>
> I have to use an Ingres DB and would like to create a web app using a 
> Python framework. Unlike other frameworks I see web2py says it supports 
> Ingres. Is anybody successfully using web2py with an Ingres DB and does it 
> work well?
>

-- 
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: Two database join query

2017-08-31 Thread Massimo Di Pierro
This is logically impossible. The role of a database it to store data and 
execute queries about the local data. If you have two, which one should 
execute the query? Each one of them can only search local data. databases 
do not talk to each other.

The only solution is not to do it in a query but do the join at the python 
level:

rows = db1(db1.table1).select()
ids = [row.pid for row in rows]
rows_tojoin = db2(db2.table2.pid.belongs(ids)).select()
maps = {row.pid: row for row in rows_tojoin}
joined = []
for row in rows:
 joined.append({'table1':row, 'table2':maps[row.pid]})
for row in joined:
 print row['table1'], row['table2']



sql ="SELECT db1.id, db1.title,db2.data FROM db1.table1 INNER JOIN 
db2.table2 ON db2.table2.pid == db1.table1.pid"




On Monday, 28 August 2017 11:04:29 UTC-5, Artem wrote:
>
> Hello !
> Hope someone can help . Thanks in advance !
> I have two database :
> db1 = DAL('sqlite://first.sqlite')
> db2 = DAL('sqlite://second.sqlite')
> with tables :
> db1.define_table('table1',
> Field('id',requires=IS_NOT_EMPTY()),
> Field('pid',type='integer'),
> Field('title',type='string'),
> )
> and
> db2.define_table('table2',
> Field('id',requires=IS_NOT_EMPTY()),
> Field('pid',type='integer'),
> Field('data',type='string'),
> )
> How to execute sqlite join ,something like: 
> sql ="SELECT db1.id, db1.title,db2.data FROM db1.table1 INNER JOIN 
> db2.table2 ON db2.table2.pid == db1.table1.pid"
> db1.executesql(sql) doesn't work 
>
>
>

-- 
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 create pdf report in web2py???

2017-08-31 Thread Massimo Di Pierro
Nice!

On Saturday, 26 August 2017 08:19:30 UTC-5, Alex wrote:
>
> We created a report tool since creating pdf reports in a web application 
> is a common problem and none of the existing solutions were optimal for us. 
> We needed something that is easy to integrate, easy to use (to design the 
> reports) and easy to maintain (e.g. to create new versions of an existing 
> report template).
>
> https://www.reportbro.com
>
> The designer to create report templates is a javascript plugin which can 
> easily be integrated in a web application. Server-side we developed a 
> python package - which you can either download or install via pip - to 
> create the pdf (or xlsx) file with a given report template and data. 
> Because it's python it is easy to use in an existing web2py app.
>
> We appreciate any kind of feedback!
>
> Alex
>
>

-- 
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: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-31 Thread Massimo Di Pierro
you have the latest web2py but you have an older pydal.

On Tuesday, 29 August 2017 03:47:39 UTC-5, Jitun John wrote:
>
> Hi Massimo,
>
> I have the 2.15.3 version installed, but the issue remains.
> I confirm the same code works on 2.14.6
>
>
>
> <https://lh3.googleusercontent.com/-HVkJkUDVqYs/WaUpZlVmP3I/Crc/A-cvkZQcRw4YE3ANPQbwPAbJBjzvLrVmACLcBGAs/s1600/sqlite_file_open_error.jpg>
>
>
>
>
>
>
>
>
> On Sunday, August 13, 2017 at 2:40:08 AM UTC+5:30, Massimo Di Pierro wrote:
>>
>> Committed c995fd7 that should fix 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: Rocket logs and server crash

2017-08-31 Thread Massimo Di Pierro
Can you tell us more about your setup?

On Monday, 28 August 2017 13:54:05 UTC-5, Dave S wrote:
>
> I came in to a message from UptimeRobot that my server was down (4:20 am 
> mytime).  So I check the logs ...
>
> The httpserver.log file ends at 4:02, with the last successful UptimeRobot 
> check.  The logs/web2py.log has 3 entries beyond that, at 4:05 Rocket is 
> throwing an exception because self.sslobj.do_handshake() got "Connection 
> reset by peer".  Unfortunately, the traceback report doesn't indicate who 
> the peer is  is this something left over from the UR check, or a 
> different client trying to access the service?
>
> ps -ef indicated that all my python processes were still running, but my 
> browser timed out looking for the index page.  I killed all the processes, 
> restarted everything, and server is now responding normally to me and to 
> UptimeRobot.  Even though I'm preparing to switch to nginx, I'd like to 
> better understand the Rocket "crash".
>
> The process had been started from the command line, and put in the 
> background (and the parent shell eventually quitted).  As an orphan 
> process, no console messages are on the screen, and there is no more detail 
> in the logs than the 3 tracebacks (all the same).  The top level is 
> rocket.py, line 590 (2.14.6), in listen(), which calls self.wrap_socket(), 
> etc.  Is there any place besides the log to look for artifacts that would 
> give me more information?  Oh, /var/log/messages has a "Possible SYN 
> flooding pn port 443" entry at 4:05.
>
> Thanks for any pointers.
>
> Dave
> /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] Re: Is it posible to fallback to static files when a controller is not found?

2017-08-31 Thread Massimo Di Pierro
routes_out is used when mapping a URL('controller','function') into an 
actual url. It is called reversed routing in other frameworks.

On Sunday, 27 August 2017 17:49:47 UTC-5, Alfonso Serra wrote:
>
> Simpler and better approach:
>
> routes_in = (
> # do not reroute admin unless you want to disable it
> (BASE + '/admin', '/admin/default/index')
> , (BASE + '/admin/$anything', '/admin/$anything')
> # do not reroute appadmin unless you want to disable it
> , (BASE + '/$app/appadmin', '/$app/appadmin/index')
> , (BASE + '/$app/appadmin/$anything', '/$app/appadmin/$anything')
>
> # default controller
> , ('/', '/%s/default/index' % default_application)
> , ('/$c', '/%s/$c/index' % default_application)
> , ('/$c/$f', '/%s/$c/$f' % default_application)
> , ('/$anything', '/%s/static/$anything' % default_application)
> , (BASE + '/$anything', '/$anything')
> ]
>
> routes_out = (
> # do not reroute admin unless you want to disable it
> ('/admin/$anything', BASE + '/admin/$anything')
> # do not reroute appadmin unless you want to disable it
> , ('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything')
> )
>
> Works well, when a static file is not found i get the http right code. I 
> have to put aside web2py default autoroutes but this is what i wanted.
>
> I still dont quite get routes_out, when is a route coming from the app? is 
> it only on redirections? 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: easy deploy on OpenShift

2017-08-23 Thread Massimo Di Pierro
Thanks Manuele,

can I ask for a patch to the examples app that links to your page?

On Tuesday, 22 August 2017 04:02:21 UTC-5, Manuele wrote:
>
> Dear web2py users, 
>
> I'd like to submit to your attention this github project: 
>
> https://github.com/manuelep/openshift_web2py 
>
> it's a fork from the original homonym project  no more mantained. Now 
> the web2py project is inserted as a subproject so anybody can easily 
> choose the preferred framework version to work with. 
>
> Do you see any problem in it or have suggestions? Any contribution is 
> welcome! :) 
>
> Cheers 
>
>  Manuele 
>
>

-- 
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: web2py with js framework

2017-08-23 Thread Massimo Di Pierro
This is fantastic!

On Wednesday, 16 August 2017 16:23:41 UTC-5, Ramos wrote:
>
> The first video tut about this deserves a beer...
>
>
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
>  Sem 
> vírus. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
>  
> <#CAEM0BxNvg35DwtSoS6pRdN2Zme+fGTN4N1pNhZsqS_SG73qCuQ@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> 2017-08-16 20:29 GMT+01:00 Val K <valq7...@gmail.com>:
>
>> @Massimo and @All concerned  
>> Uploaded <https://github.com/valq7711/rapydml_cmp> to github with short 
>> manual and examples.
>> Discussion is welcome! 
>>
>>
>> On Wednesday, August 16, 2017 at 6:00:36 AM UTC+3, Massimo Di Pierro 
>> wrote:
>>>
>>> I want to know more.
>>>
>>> On Tuesday, 15 August 2017 18:40:57 UTC-5, Val K wrote:
>>>>
>>>>
>>>> Considering the number of views, this issue is quite exciting.
>>>>
>>>> Here is my experience. I use RapydML and  RapydScript to generate 
>>>>  Vue-components.
>>>>
>>>> I wrote brute-force parser + made some hacks of RapydML-compiler so, as 
>>>> exhaust I receive single js-file with embeded template as html-string.
>>>>
>>>> If anyone is interested, I can describe in more detail. In gVim it 
>>>> looks like this:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> <https://lh3.googleusercontent.com/-SWHAIsxMvcE/WZOFDZqjxlI/AB4/rH3olx6FH8cirbUaZh9M54XMnqU9rQzSgCLcBGAs/s1600/v_hello.png>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Tuesday, August 15, 2017 at 8:23:34 AM UTC+3, Limedrop wrote:
>>>>>
>>>>> @Carlos...I don't know if this is better, but it is different.  
>>>>> Probably more suited to bigger apps.  My basic assumption is that if 
>>>>> you're 
>>>>> going to use vue.js then, ultimately, it will be a lot easier if you 
>>>>> stick 
>>>>> to the proper vue.js way of doing things.  In general this means letting 
>>>>> vue.js do it's stuff with the frontend and leaving web2py with the data 
>>>>> and 
>>>>> backend.
>>>>>
>>>>> Specifically it means setting up your view files like this:
>>>>> https://vuejs.org/v2/guide/single-file-components.html
>>>>>
>>>>> And using this:
>>>>> https://github.com/vuejs-templates/webpack
>>>>>
>>>>> In development mode I have web2py running on one port and node running 
>>>>> on another (node's hot-reloading seems like magic, and you can use the 
>>>>> chrome VueDevtools plugin to debug). When I'm ready to commit I run "npm 
>>>>> run build".  The index file is then compiled to 
>>>>> "/views/default/index.html", and the assets are compiled to "/static".
>>>>>
>>>>> In production I get web2py to serve the index file and then get vue.js 
>>>>> to load whatever else it needs via ajax (axios).
>>>>>
>>>>> A basic outline of the key files are given below.  Note that these are 
>>>>> just snippets to show you how you might do it...the code is incomplete 
>>>>> and 
>>>>> it will NOT work out-of-the-box.
>>>>>
>>>>>
>>>>> \web2py\applications\app\controllers\default.py
>>>>>
>>>>> def index():
>>>>> """ Starts vue.js session
>>>>> 
>>>>> The uuid is injected into the html  tag as
>>>>> the id.  For example: >>>> id="14e4de39-dc9e-467f-a28e-9c78bd485bc1">
>>>>> 
>>>>> vue.js then uses status_load() to retrieve the session details.
>>>>> """
>>>>> uuid = session_new()
>>>>> return dict(UUID=uuid)
>>>>>
>>>>> def status_load():
>>>>> uuid, error = 
>>>>> IS_MATCH('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\Z')(request.vars['uuid'])
>>>>> if error:
>>>>> raise HTTP(403, "Not authorized")
>>>>> query = (db.vue_session.uuid

[web2py] Re: web2py with js framework

2017-08-15 Thread Massimo Di Pierro
I want to know more.

On Tuesday, 15 August 2017 18:40:57 UTC-5, Val K wrote:
>
>
> Considering the number of views, this issue is quite exciting.
>
> Here is my experience. I use RapydML and  RapydScript to generate 
>  Vue-components.
>
> I wrote brute-force parser + made some hacks of RapydML-compiler so, as 
> exhaust I receive single js-file with embeded template as html-string.
>
> If anyone is interested, I can describe in more detail. In gVim it looks 
> like this:
>
>
>
>
>
> 
>
>
>
>
>
>
> On Tuesday, August 15, 2017 at 8:23:34 AM UTC+3, Limedrop wrote:
>>
>> @Carlos...I don't know if this is better, but it is different.  Probably 
>> more suited to bigger apps.  My basic assumption is that if you're going to 
>> use vue.js then, ultimately, it will be a lot easier if you stick to the 
>> proper vue.js way of doing things.  In general this means letting vue.js do 
>> it's stuff with the frontend and leaving web2py with the data and backend.
>>
>> Specifically it means setting up your view files like this:
>> https://vuejs.org/v2/guide/single-file-components.html
>>
>> And using this:
>> https://github.com/vuejs-templates/webpack
>>
>> In development mode I have web2py running on one port and node running on 
>> another (node's hot-reloading seems like magic, and you can use the chrome 
>> VueDevtools plugin to debug). When I'm ready to commit I run "npm run 
>> build".  The index file is then compiled to "/views/default/index.html", 
>> and the assets are compiled to "/static".
>>
>> In production I get web2py to serve the index file and then get vue.js to 
>> load whatever else it needs via ajax (axios).
>>
>> A basic outline of the key files are given below.  Note that these are 
>> just snippets to show you how you might do it...the code is incomplete and 
>> it will NOT work out-of-the-box.
>>
>>
>> \web2py\applications\app\controllers\default.py
>>
>> def index():
>> """ Starts vue.js session
>> 
>> The uuid is injected into the html  tag as
>> the id.  For example: 
>> 
>> vue.js then uses status_load() to retrieve the session details.
>> """
>> uuid = session_new()
>> return dict(UUID=uuid)
>>
>> def status_load():
>> uuid, error = 
>> IS_MATCH('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\Z')(request.vars['uuid'])
>> if error:
>> raise HTTP(403, "Not authorized")
>> query = (db.vue_session.uuid==uuid)
>> session = 
>> db(query).select(orderby=~db.vue_session.expiry_datetime).first()
>> if not session:
>> raise HTTP(403, "Not authorized")
>> return response.json(session)
>> 
>>
>> \web2py\applications\app\views\index.html
>> ## The COMPILED VUE.JS FILE GOES HERE!!!
>>
>>
>> \vue\index.html
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>>   
>> 
>>
>> \vue\src\App.vue
>> 
>>   
>> 
>> 
>> 
>>   
>> 
>>
>> 
>> export default {
>>   name: 'app',
>>   components: {
>>   },
>>   data () {
>> return {
>> }
>>   },
>>   computed: {
>>   },
>>   methods: {
>>   },
>>   mounted: function () {
>> // The uuid is injected into the parentElement by web2py
>> // The store will then use the uuid to get the session from web2py
>> // and may redirect to the restore_point
>> this.$store.dispatch('NEW_UUID', { uuid: this.$el.parentElement.id })
>>   }
>> }
>> 
>>
>> \vue\src\store\index.js
>> import Vue from 'vue'
>> import Vuex from 'vuex'
>> import axios from 'axios'
>> import router from '../router'
>> Vue.use(Vuex)
>> var axiosi = axios.create({
>>   baseURL: '/myapp/default/',
>>   timeout: 5000
>> })
>> const store = new Vuex.Store({
>>   state: {
>> // put your session variables here
>>   },
>>   actions: {
>> NEW_UUID: function ({ commit, dispatch, state }, { uuid }) {
>>   // At the start of each session web2py gives us a uuid
>>   // We then go back to web2py and retrieve the session state
>>   commit('SET_UUID', { uuid: uuid })
>>   var data = {}
>>   data.uuid = uuid
>>   axiosi.post('status_load', data).then((response) => {
>> commit('UPDATE_STATUS', { newState: response.data })
>>   }, (err) => {
>> console.log(err)
>> router.push({ name: 'error', params: { errorMessage: 
>> err.response.data } })
>>   })
>> }
>>
>>
>>

-- 
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: Admin UI - Error ticket less information in the latest web2py releases

2017-08-15 Thread Massimo Di Pierro
very weird. Can you open a ticket about this?

On Tuesday, 15 August 2017 10:19:42 UTC-5, Paolo Caruccio wrote:
>
> Hello everyone.
>
> In a view, I have a trivial NameError: name 'fattura' is not defined due to
>
> {{for ft in fatture:}}
> {{=fattura.id}}
> {{pass}}
>
> But the Error Ticket returned by web2py is different depending on the 
> development environment.
>
> *Case 1 (best)*
> SO: windows 8
> Web2py: Version 2.14.6-stable + timestamp.2016.05.10.00.21.47
> Python: Python 2.7.13
>
>
> 
>
>
> *Case 2*
> SO: windows 8
> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
> Python: Python 2.7.13
> *Filename missing*
>
>
> 
>
>
> *Case 3*
> SO: Linux MInt 8.2
> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
> Python: Python 2.7.12
> *The same as the case 2 but also Error snapshot and Python version are 
> missing. *
>
>
> 
>
>
> *Case 4 (worse)*
> SO: Linux MInt 8.2
> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
> Python: Python 3.6.2
> *Python version, reference to filename and line are missing. New exception 
> occurred.*
>
>
> 
>
>
>
> Has anyone ever encountered this problem? How did he solve it?
>
> 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: Weird problems generating menu from database

2017-08-15 Thread Massimo Di Pierro
Replace:

response.menu = cache.ram('menu', lambda:build_menu(), None) # to cache it!

with

submenu = cache.ram('menu', lambda:build_menu(), None) # to cache it!
response.menu =[('Main', False, URL('default', 'index'), submenu]


On Monday, 14 August 2017 02:50:09 UTC-5, Вячеслав Анатольевич wrote:
>
> Hi Massimo! Thanks so much! It Works! But it generate menu in inline, like 
> this:
>
> menu1 menu1menu1
>
> In menu1-menu2 in menu2-mnm_name (thats all right) But how menu1 insert in 
>
> response.menu =[
>('Main', False, URL('default', 'index'), [here]]
>
>
>

-- 
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: keyError : ‘fields’

2017-08-12 Thread Massimo Di Pierro
Thanks. Fixed in trunk.

On Thursday, 10 August 2017 15:02:27 UTC-5, Lazaro Aulan wrote:
>
> Hello everyone!
>
> We are running a small application in web2py 2.14.6
>
> Checking the application with 2.15.3 we got a error on 
>
> web2py-2.15.3/gluon/packages/dal/pydal/objects.py  in line 2946, in  
> __getstate__, 
> del ret['fields']
> keyError : ‘fields’
> ...
> 2944def __getstate__(self):
> 2945ret = self.__dict__.copy()
> 2946del ret['fields']
> 2947return ret
> …
>
> we changed line 2496  to:
> ret.pop('fields', 0)
> or to
> if ret.get('fields'):
> del ret['fields']
>
> the question is.
>
> What is wrong with ‘fields’ ?
>
> Thank.
>

-- 
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: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-12 Thread Massimo Di Pierro
Committed c995fd7 that should fix this

On Tuesday, 8 August 2017 14:40:34 UTC-5, Lisandro wrote:
>
> Same problem here, but using PostgreSQL.
> This is the function that I was using to connect to a database:
>
> def connect_db(db_host, db_name, db_user, db_user_password):
> # gets the table_hash from one of the .table files in the databases 
> folder
> table_hash = None
> for file in os.listdir(databases_folder):
> if archivo.endswith('.table'):
> table_hash = file.split('_')[0]
> break
> return DAL('postgres://%s:%s@%s:5432/%s' % (db_user, db_user_password, 
> db_host, db_name),
>migrate=False,
>folder=databases_folder,
>auto_import=True,
>table_hash=table_hash)
>
>
> But after upgrading to 2.15.3, the function throws this error:
>
> Traceback (most recent call last):
>   File "/home/gonguinguen/medios/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File 
> "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", line 
> 550, in 
>   File "/home/gonguinguen/medios/gluon/globals.py", line 409, in 
> self._caller = lambda f: f()
>   File 
> "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", line 
> 548, in prueba
> dbs = sitio.conectar_db()
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/objects.py", line 
> 2368, in __call__
> return self.method(self.row, *args, **kwargs)
>   File "/home/gonguinguen/medios/applications/webmedios/models/db.py", line 
> 149, in 
> Field.Method('conectar_db', lambda row: sitios_conectar_db(row.sitios)),
>   File "applications/webmedios/modules/virtual_methods.py", line 79, in 
> sitios_conectar_db
> table_hash=table_hash)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 170, 
> in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 500, 
> in __init__
> tables=tables)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 522, 
> in import_table_definitions
> tfile = self._adapter.file_open(filename, 'r')
> AttributeError: 'PostgrePsyco' object has no attribute 'file_open'
>
>
>
> Meanwhile, I'll check if there is an opened issue about this.
> Let me know if there is anything I can do to help you fix the problem.
>
>
> El jueves, 20 de julio de 2017, 18:56:29 (UTC-3), Massimo Di Pierro 
> escribió:
>>
>> Can you please open a PyDAL ticket so we can track. This should work.
>>
>> On Saturday, 15 July 2017 05:13:45 UTC-5, Jitun John wrote:
>>>
>>> Here is a Code that worked fine on 2.14.6 but doesn't on 2.15.1
>>>
>>>
>>> import datetime
>>> import gc
>>> import os
>>> from gluon import *
>>> from current_config import *
>>> from memory_profiler import memory_usage
>>>
>>>
>>> manager_rows = ''
>>>
>>>
>>> dummy_path = os.path.abspath('.') + 
>>> '/applications/enLIGHTen/static/dummy/'
>>>
>>>
>>> def read_alerts_rows():
>>> alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>>> get_current_path(), auto_import=True)
>>> global alerts_rows
>>> alerts_rows = alerts_db_conn(alerts_db_conn.alerts_log.id > 0).
>>> select(orderby=alerts_db_conn.alerts_log.datetime)
>>> alerts_db_conn.close()
>>>
>>>
>>> def get_alerts_rows():
>>> return alerts_rows
>>>
>>>
>>> 
>>>
>>>
>>> def add_clear():
>>> dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>>> dummy_path, auto_import=True)
>>> global alerts_rows
>>>
>>>
>>> 
>>>
>>>
>>> Gives the following error.
>>>
>>> File "applications\enLIGHTen\modules\read_logs_to_rows.py", line 141, in 
>>> add_clear
>>>  dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=dummy_path, 
>>> auto_import=True)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 170, in __call__
>>>  obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 500, in __init__
>>>  tables=tables)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 522, in import_table_definitions
>>>  tfile = self._adapter.file_open(filename, 'r')
>>> AttributeError: 'SQLite' object has no attribute 'file_open'
>>>
>>> Any pointers/help is appreciated.
>>>
>>>
>>>
>>>
>>>

-- 
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: Problem with Grid Exporter since upgrade from 2.14.6 to 2.15.2 / 2.15.3

2017-08-12 Thread Massimo Di Pierro
I opened an issue: https://github.com/web2py/web2py/issues/1733 
will be taken care of asap.

On Monday, 7 August 2017 19:08:38 UTC-5, Simon Riek wrote:
>
> Since updating from 2.14.6 to 2.15.2 (and also 2.15.3 released just 
> moments ago) I have some problems with the default ExportClasses in 
> SQLFORM.grid.
> I am using MSSQL as database.
> The grid displays just fine, only the export faild (to tsv and, in some 
> cases, to csv - I did not test others).
>
> I'll spare you the complete traceback and get directly to what I could 
> find by implementing my own ExportClass.
>
> At first I got a , the relevant 
> traceback was:
>
> File "C:\Users\riek\PycharmProjects\web2py\gluon\sqlhtml.py", line 3563, in 
> represented
> row.append(record._extra[col])
>
> I didn't use any type _extra fields, meaning that the regex check in line 
> 3562 failed (self.rows.db._adapter.REGEX_TABLE_DOT_FIELD.match(col)).
>
> I then overwrote the "represented"-Function with my own, ignoring this 
> check and forcing the else-branch. 
>
> This lead to the following exception:  
> 'DAL' object has no attribute '"t_schule"'. So my tables and fields are 
> quoted and thus not found.
>
> I tried a solution I found somewhere else, setting entity_quoting=False in 
> my DAL-instance, didn't change anything.
>
> I then searched some more and found this bugfix: 
> https://github.com/web2py/web2py/issues/1542
> It appears that this fix quotes the tables and fields, no matter 
> if entity_quoting is enabled or not.
>
> I could solve my particular problem with an ugly hack, by removing the 
> quotes in the represent-function of my ExportClass (line 3565 in 
> sqlhtml.py: *(t, f) = col.replace('"','').split('.') * instead of *(t, f) 
> = col.split('.')) *
> I am wondering though if this is a bug or I am not properly understanding 
> how the quoting works.
>
>
>
>
>

-- 
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] web2py 2.15.3 is OUT

2017-08-07 Thread Massimo Di Pierro
Contains lots of small fixes. 
Many thanks to Leonel for taking care of many urgent issues in a hurry.

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


[web2py] Re: paired fields in web2py

2017-08-07 Thread Massimo Di Pierro
You can use SQLFORM.factory but I recommend something like vue, ractive, or 
angular. In in the end it makes things simpler.


On Monday, 7 August 2017 01:01:05 UTC-5, Mumtoz Dalimov wrote:
>
> Thanks a lot, Massimo.
> I understood the structure of the model. 
>
> Any ideas how to make convenient input of data in the View. 
> Should inputter remember invoice.id each time he inputs invoice_item to 
> get invoice_items grouped?
> Maybe I better use SQLFORM.factory to get 2 tables populated at once? And 
> how then get one list field (QUANTITY) multiplied when another(PRODUCT)  is 
> multiplied?
>
>
>

-- 
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: Weird problems generating menu from database

2017-08-07 Thread Massimo Di Pierro
So I think...

db = DAL('sqlite://storage.sqlite')

db.define_table('map',Field('menu1'),Field('menu2'),Field('mnm_name'),Field(
'link'))


import collections

def build_menu():

m1, m2 = [], [] # to preserve orders   
   

m = collections.defaultdict(lambda: collections.defaultdict(list))

for row in db(db.map).select(orderby=db.map.menu1|db.map.menu2):

if not row.menu1 in m1: m1.append(row.menu1)

if not row.menu2 in m2: m2.append(row.menu2)

m[row.menu1][row.menu2].append((row.mnm_name, row.link))

menu = []

for a in m1:

submenu = []

menu.append([a, None, None, submenu])

for b, items in m[a].items():

subsubmenu = [[key, None, link] for key, link in items]

submenu.append([b, None, None, subsubmenu])

return menu


response.menu = cache.ram('menu', lambda:build_menu(), None) # to cache it!



On Sunday, 6 August 2017 04:31:00 UTC-5, Вячеслав Анатольевич wrote:
>
> Thanks, Massimo!
> So, i have a database table - named "map", in that table - three field - 
> menu1, menu2, mnm_name.
> Menu mast be like that:
> 
>- menu1
> - menu2
>   -mnm_name
> In menu1 - menu2, in menu2 - mnm_name
>

-- 
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: Error in appadmin (database admin) on python 3

2017-08-07 Thread Massimo Di Pierro
please open a ticket in web2py or pydal, I can fix this in either place.

On Sunday, 6 August 2017 10:07:40 UTC-5, Kirill Shatalaev wrote:
>
> Hello, when using python3 and database admin, I got this error:
>
>  name 'unicode' is not defined
>
> You need to click on any table name (for example, 
> http://127.0.0.1:8000/welcome/appadmin/select/db?query=db.auth_user.id%3E0
> ).
>
> I think this is python3 unicode -> str specific related trouble.
>
>
>
>

-- 
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: admin password in web2py docker not correct

2017-08-07 Thread Massimo Di Pierro
I think your first proposed fix is better. the change in gluon/main.py 
should not be needed. It should not be completely impossible to have a " " 
in a password.

On Saturday, 5 August 2017 11:44:46 UTC-5, JaapP wrote:
>
> Hi,
>
> Hope to save someone with the same problem some time:
>
> i encountered a problem running web2py in a docker; the admin password as 
> set from the start command was not recognised when trying to log into the 
> admin interface.
>
> Wrong dockerfile snippet:
>
> EXPOSE 8000
> CMD ["/usr/bin/python", "/home/web2py/web2py.py", "-i 0.0.0.0", "-p 8000", 
> "-a 
> admin"]
>
>
> web2py thinks (sees) the admin password being ' admin' (space in front of 
> the password).
>
> What *does* work: 
>
> EXPOSE 8000
> CMD ["/usr/bin/python", "/home/web2py/web2py.py", "-i 0.0.0.0", "-p 8000", 
> "-a","admin"]
>
>
>
> If acceptable, this problem could also be solved by changing save_password 
> in gluon/main.py:
>
> else:
> # use provided password
> cpassword = CRYPT()(password.strip(' '))[0]
>
>
>
> Best regards,
>
> Jaap
>
>

-- 
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: Unable to start web2py 2.15.2 with ssl

2017-08-07 Thread Massimo Di Pierro
Included the fix in 2.15.3 but please check it in case I got it wrong.

On Friday, 4 August 2017 11:18:45 UTC-5, José Leite wrote:
>
> Thanks, just submitted the issue.
>
> sexta-feira, 4 de Agosto de 2017 às 16:58:14 UTC+1, Leonel Câmara escreveu:
>>
>> Still, probably a bug if it still doesn't work with the has_ssl change, 
>> submit an issue.
>>
>

-- 
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: MS-SQL DAL Problem ( connecting is ok )

2017-08-07 Thread Massimo Di Pierro
Thanks for reporting this. Included in 2.15.3

On Friday, 4 August 2017 16:33:37 UTC-5, Razvan Cristian wrote:
>
> Good evening!
>
> Yes, the fix worked! Yuhu!!! 
> Thank you very much for your fast fix and reply.
>
> Have a nice weekend!
>
> On Friday, August 4, 2017 at 6:18:58 PM UTC+3, Massimo Di Pierro wrote:
>>
>> I committed a fix to pysql just now. Can you check it fixes the problem 
>> for you?
>>
>> On Thursday, 3 August 2017 16:57:45 UTC-5, Razvan Cristian wrote:
>>>
>>>
>>> Hello all!
>>>
>>> I am in the process of learning web2py. I downloaded the binaries and 
>>> the sources for windows and give it a run but i encountered a problem.
>>>
>>> When i try to create a new user ( from welcome app )  i get the 
>>> following error : 
>>>
>>> " File "d:\web2py_surse\web2py\gluon\contrib\pypyodbc.py", line 954, in 
>>> ctrl_err
>>> raise ProgrammingError(state,err_text)
>>> ProgrammingError: (u'42000', u"[42000] [Microsoft][ODBC SQL Server 
>>> Driver][SQL Server]Incorrect syntax near the keyword 'TOP'.") "  visual 
>>> studio debugger output
>>>
>>> and from sql profiler i see that the DAL generates the following sql : 
>>> "SELECT "auth_user"."id", "auth_user"."email" FROM "auth_user" WHERE 
>>> ("auth_user"."email" = 'christia...@gmail.com') TOP 1;"  which it is 
>>> not correct , it should be   "SELECT  TOP 1 "auth_user"."id", 
>>> "auth_user"."email" FROM "auth_user" WHERE ("auth_user"."email" = '
>>> christia...@gmail.com') ;"
>>>
>>> I browsed a while through sources but can't find where the query is 
>>> generated...( still learning the web2py code :) )
>>>
>>> Any ideas? 
>>>
>>> PS: the error occurs even if i run from the binaries.
>>>
>>> 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] book help

2017-08-04 Thread Massimo Di Pierro
The book is online https://github.com/web2py/web2py-book
You can fork it edit it, then submit a PR. You should be able to do 
everything online.

Massimo

On Friday, 4 August 2017 10:43:14 UTC-5, CDA wrote:
>
> I'll be more than happy to assist. How do I start?
>
> On Aug 4, 2017 11:34 AM, "Massimo Di Pierro" <massimo.dipie...@gmail.com> 
> wrote:
>
>> Can I ask for some help in editing the book. specifically:
>>
>> 1) describe {{=ASSIGNJS(js_var = python_var)}}
>>
>> 2) new syntax to store .table files in DB itself instead of in the 
>> filesystem (works with any DB)
>>
>> from gluon import DAL, Field
>>
>> from gluon.dal import InDBMigrator
>>
>> db = DAL(uri, adapter_args=dict(migrator=InDBMigrator))
>>
>> 3) new syntax to connect to MySQL and Potgresql on GAE
>>
>> Follow instructions 
>> https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql 
>> then use DAL//web2py URI:
>>
>>
>> "google:MySQLdb://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone
>> :dbinstancename"
>>
>>
>> "google:psycopg2://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone
>> :dbinstancename"
>>
>> In this case the adapter_args=dict(migrator=InDBMigrator)) is the default 
>> behavior. 
>>
>> 4) If you need to select lots of data and you do not want web2py to parse 
>> it into object but get the raw data as returned by the DB as a list of 
>> tuples:
>>
>> rows = db(query).select(processor=lambda *a,**b: a[0])
>>
>> -- 
>> 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] book help

2017-08-04 Thread Massimo Di Pierro
Can I ask for some help in editing the book. specifically:

1) describe {{=ASSIGNJS(js_var = python_var)}}

2) new syntax to store .table files in DB itself instead of in the 
filesystem (works with any DB)

from gluon import DAL, Field

from gluon.dal import InDBMigrator

db = DAL(uri, adapter_args=dict(migrator=InDBMigrator))

3) new syntax to connect to MySQL and Potgresql on GAE

Follow 
instructions 
https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql 
then use DAL//web2py URI:

"google:MySQLdb://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone
:dbinstancename"

"google:psycopg2://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone
:dbinstancename"

In this case the adapter_args=dict(migrator=InDBMigrator)) is the default 
behavior. 

4) If you need to select lots of data and you do not want web2py to parse 
it into object but get the raw data as returned by the DB as a list of 
tuples:

rows = db(query).select(processor=lambda *a,**b: a[0])

-- 
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: paired fields in web2py

2017-08-04 Thread Massimo Di Pierro
I would do

db.define_table('customer',Field('name'))
db.define_table('product',Field('name'))
db.define_table('invoice',Field('customer','reference customer'))
db.define_table('invoice_item',Field('invoice','reference 
invoice'),Field(product','reference product'),Field('quantity','integer'))

customer = db.customer(name="Pinco Pallino")
for invoice in db(db.invoice.customer == customer.id).select():
  print invoice.id
  items = 
db(db.invoice_item.product==db.product.id)(db.invoice_item.invoice==invoice.id).select()
  print items



On Friday, 4 August 2017 09:45:51 UTC-5, Mumtoz Dalimov wrote:
>
> Hello,
>
> Is it possible to create table with 2 fields for example, list:reference 
> , which are being multiplied pairly.
> How to input this kind of info in one record of table
>
> Customer>Bob
> Product:BookAmount:20
> Product:Pencil  Amount:39
>
> Customer>John
> Product:PenAmount:7
> Product:Pencil  Amount:39
> Product:Backpack  Amount:1
>
> I am very new in coding and web2py, so need your help
> 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: Error with Reading ListReferences in web2py 2.15.2 from database

2017-08-04 Thread Massimo Di Pierro
Yes this is correct. The other syntax worked by accident.

On Friday, 4 August 2017 10:03:04 UTC-5, José Leite wrote:
>
> I changed the Syntax to:
>
> db.intro_lifestyles.tourism_segment_id.contains(segment.id)
>
> and it is now working.
>
> Thanks a lot that would be a solution too...
>
> quinta-feira, 3 de Agosto de 2017 às 23:18:23 UTC+1, Anthony escreveu:
>>
>> Have you tried:
>>
>> db.intro_lifestyles.tourism_segment_id == [segment.id]
>>
>> Your original code may have worked in the older version, but I don't 
>> think that syntax was officially supported.
>>
>> Anthony
>>
>> On Thursday, August 3, 2017 at 5:57:45 PM UTC-4, José Leite wrote:
>>>
>>> I have just updated to web2py 2.15.2 and my site www.holidaysenses.com 
>>> became 
>>> unstable (unusable).
>>>
>>> Line codes like:
>>> image = db(db.intro_lifestyles.tourism_segment_id == segment.id
>>> ).select().first()
>>> or
>>> image = db(db.intro_regions.region_id == region.id).select().first()
>>>
>>> where db.intro_lifestyles.tourism_segment_id and 
>>> db.intro_regions.region_id are List:references with only one element each 
>>> to tables "segment" and "region" respectively raise the following error:
>>>
>>> File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py", line 
>>> 95, in bar_encode
>>> return '|%s|' % '|'.join(bar_escape(item) for item in items if 
>>> str(item).strip())
>>> TypeError: 'long' object is not iterable
>>>
>>> The site was working fine before...
>>>
>>

-- 
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: MS-SQL DAL Problem ( connecting is ok )

2017-08-04 Thread Massimo Di Pierro
I committed a fix to pysql just now. Can you check it fixes the problem for 
you?

On Thursday, 3 August 2017 16:57:45 UTC-5, Razvan Cristian wrote:
>
>
> Hello all!
>
> I am in the process of learning web2py. I downloaded the binaries and the 
> sources for windows and give it a run but i encountered a problem.
>
> When i try to create a new user ( from welcome app )  i get the following 
> error : 
>
> " File "d:\web2py_surse\web2py\gluon\contrib\pypyodbc.py", line 954, in 
> ctrl_err
> raise ProgrammingError(state,err_text)
> ProgrammingError: (u'42000', u"[42000] [Microsoft][ODBC SQL Server 
> Driver][SQL Server]Incorrect syntax near the keyword 'TOP'.") "  visual 
> studio debugger output
>
> and from sql profiler i see that the DAL generates the following sql : 
> "SELECT "auth_user"."id", "auth_user"."email" FROM "auth_user" WHERE 
> ("auth_user"."email" = 'christian.raz...@gmail.com') TOP 1;"  which it is 
> not correct , it should be   "SELECT  TOP 1 "auth_user"."id", 
> "auth_user"."email" FROM "auth_user" WHERE ("auth_user"."email" = '
> christian.raz...@gmail.com') ;"
>
> I browsed a while through sources but can't find where the query is 
> generated...( still learning the web2py code :) )
>
> Any ideas? 
>
> PS: the error occurs even if i run from the binaries.
>
> 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: Weird problems generating menu from database

2017-08-04 Thread Massimo Di Pierro
Yes. It is possible but I am a little confused by your model to be able to 
provide an example that works for you.

Can you please provide your model again an example of data that should 
comprise the menu?

Notice what you seek is done 
here: https://github.com/web2py/web2py/blob/master/gluon/tools.py#L6358 for 
the wiki menu, where the menu is parsed form the wiki-menu page.

Massimo

On Wednesday, 2 August 2017 21:55:07 UTC-5, Dave S wrote:
>
>
>
> On Wednesday, August 2, 2017 at 12:12:04 AM UTC-7, Вячеслав Анатольевич 
> wrote:
>>
>> Me personally, no, but I understand BS3 limits the number of menu levels.
>>>
>>> /dps
>>>  
>>>
>>
>> So, it is inpossible or not? I'm ask because it's hard to puzzle over 
>> this or it's really impossible?
>>
>
> Sorry, outside of my limited knowledge.  I've added and subtracted items 
> from the regular navbar, and I remember a little of the conversation from 
> when the bs3 switch was made, but that's as far as I can go.  For my own 
> purposes, regular A-tags in the left column are what I use, but I rarely 
> have more than 4 places to go from a page.
>
> You need an answer from an actual guru; Massimo himself, or Anthony or 
> Leone, or Michele C (mcm).  Some of the other long-time users maybe, like 
> Richard or Joe.
>
> /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] Datatables Query String Parsing

2017-08-04 Thread Massimo Di Pierro
I also think the grid is obsolete and its code is ugly. The concept of 
pagination is old. I think it is much better to have an api and a [more] 
button that adds item at the bottom, until a new search is done. I will 
post a vue.js example of that as soon as I can.


On Tuesday, 1 August 2017 12:01:37 UTC-5, villas wrote:
>
> Hi Richard,
>
> Thanks for your points of view and I find the discussion interesting.  
> However I'm not sure that we are on the same page:
>
> For me, I would defenitly avoid using DTs as I found those kind of fancy 
>> grid too heavy (to many plugins, to many js, flash stuff, etc.)
>
>
> Datatables is not that heavy and,  anyhow,  that isn't the problem because 
> it performs well when loaded,  which sqlform.grid does not.
>
> I would prefer bare html/css closer solution, like build html table 
>> populate it and drop css from boostrap or other CSS lib. In this regard 
>> SQLFORM.grid is almost perfect
>
>
> My point is that sqlform.grid is often totally inadequate for my needs: it 
> doesn't paginate loaded datasets, cannot populate via ajax,  and makes far 
> too many queries.  All of which means I have to make my own solutions 
> (which I am not very good at).  
>
> Don't get me wrong,  I am very grateful for what web2py does for me,  but 
> I am just talking specifically about the grid here.
>
> I was interested in the vue.js,  but I'm not entirely sure how it solves 
> my problem of producing an efficient data grid listing.  
>
> Best wishes. 
>
>
>  
>
> On Monday, 31 July 2017 17:25:59 UTC+1, Richard wrote:
>>
>> Yes Villas you get good points...
>>
>> I think Massimo's had talked about abandonning SQLFROM.grid. I never been 
>> able to fully levrage it. Most of the time, I prefer handle forms myself, 
>> as they most of the time more complexe the what .grid() can handle. So 
>> there is no gain to having them to me... Tough I think we should look at 
>> SQLFORM.grid as a prototyping tools as CRUD was more then an end solution 
>> for crafting our apps. You build a prototype app fast then you rewrite it 
>> and use proper customized tools for the real final product... But it far 
>> from ideal... But I am not sure any frameworks can meet expectations of the 
>> broad wild audience... Some will argue that they don't want you to specify 
>> the grid they are going to use, other want it built in... For me, I would 
>> defenitly avoid using DTs as I found those kind of fancy grid too heavy (to 
>> many plugins, to many js, flash stuff, etc.)... I would prefer bare 
>> html/css closer solution, like build html table populate it and drop css 
>> from boostrap or other CSS lib. In this regard SQLFORM.grid is almost 
>> perfect, but I think it should be rewrite entirely with proper requirements 
>> and to me it should be strip to it main purpose GRID... Like this you don't 
>> have to manage complexe redirection with args and vars, etc. It should 
>> accept complexe query, so you are not limited to use it over as single 
>> table, CRUD select was good in this respect.
>>
>> In the future w3p
>>
>> I guess in the future web3py will not offer anything like SQLFORM.grid, 
>> just me thinking, base on what Massimo's has mention so far about web3py...
>>
>> I think grid stuff will have to be handle more like this :
>>
>> https://vuejs.org/v2/examples/grid-component.html
>>
>> https://www.ag-grid.com/angular-getting-started/#gsc.tab=0
>>
>>
>>
>> On Mon, Jul 31, 2017 at 11:16 AM, villas  wrote:
>>
>>> Hi Richard / everyone
>>>
>>> Those are good strategies.  However,  I also feel that it is a pity that 
>>> we are having to 'roll our own' solutions because the sqlform.grid just 
>>> seems too slow.
>>>
>>> Your idea of avoiding pyDAL seems to greatly reduce queries,  and so I 
>>> am also tempted down this road.  However,  again,  this undermines the 
>>> whole point of the framework.  
>>>
>>> We need a more performant grid as part of the framework and my 
>>> observations are these:
>>> 1. We need two options for loading data:  all at once,  and server-side 
>>> via ajax.  
>>> 2. We need to fill the grid with complex queries,  including proper 
>>> 'left join on' syntax,  and in-line selects.  We can then suppress all 
>>> those magical data 'represents' queries which are all done with additional 
>>> row-by-row sub-selects.  On one page of my sqlform.grid views it generated 
>>> almost a hundred queries.  I was able to replace that with a single complex 
>>> query.  
>>> 3. Ideally,  we should avoid reloading the whole page when we want to 
>>> edit the data.  For example,  using modal forms.
>>>
>>> Maybe I'm asking far too much.  However,  almost every app I write uses 
>>> a data grid and associated create/edit forms.  In simple situations I am 
>>> very grateful for the sqlform.grid.  In many other cases though,  I find 
>>> myself writing similar code over and over to produce a more performant 
>>> listing.  With my ideal framework,  I cannot help but feel 

[web2py] Re: SQLFORM.grid search type error reduce()

2017-08-04 Thread Massimo Di Pierro
Just fixed in trunk. Can you please help test the fix?

On Tuesday, 1 August 2017 03:46:13 UTC-5, Paul Ellis wrote:
>
> I am getting this error only when searching the auth_membership table
>
> I have put in a basic 'appadmin' in my webapp. I call it 'tooladmin' to 
> differentiate from the built in stuff.
>
> I use this function to edit any database table:
> def manage_table():
> tablename = request.args(0)
> pagetitle = H4('{0} {1}'.format(T('Manage'), tablename))
> buttongroup = [_btn_index()]
> table = db[tablename]
> pagecontent = SQLFORM.grid(table, args=[request.args(0)])
>
>
> response.view = 'tooladmin_core.html'
> return dict(pagetitle=pagetitle, buttongroup=buttongroup, 
> pagecontent=pagecontent)
>
> The search feature on the SQLFORM.grid is throwing this error when 
> searching the auth_membership table:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "E:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "E:/web2py/applications/OfferTool/controllers/tooladmin.py" 
> , line 
> 262, in 
>   File "E:\web2py\gluon\globals.py", line 417, in 
> self._caller = lambda f: f()
>   File "E:/web2py/applications/OfferTool/controllers/tooladmin.py" 
> , line 
> 136, in manage_table
> pagecontent = SQLFORM.grid(table, args=[request.args(0)])
>   File "E:\web2py\gluon\sqlhtml.py", line 2526, in grid
> subquery = SQLFORM.build_query(sfields, keywords)
>   File "E:\web2py\gluon\sqlhtml.py", line 1827, in build_query
> ) for k in key.split()])
> TypeError: reduce() of empty sequence with no initial value
>
>
>
>

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


<    3   4   5   6   7   8   9   10   11   12   >