Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-28 Thread Marco Mansilla
Thanks Massimo, so far it working fine. JS code is a lot more cleaner and
no need for node which is nice.

We just need native support from browsers and clients to update to latest
versions.

Marco.

El mié., 28 de mar. de 2018 13:47, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribió:

> Good work. This helps me a lot.
>
> On Friday, 23 March 2018 14:07:26 UTC-5, marco mansilla wrote:
>>
>> Just in case anyone is interested I have uploaded a simple test app with
>> VueJS as modules in the browser.
>>
>> Did it to test and see how it works, as a demo someone could find it
>> useful, more info in the readme file.
>>
>> https://github.com/marcomansilla/yava
>>
>> Opinions are always welcome and appreciated.
>>
>> --
>> -BEGIN GEEK CODE BLOCK-
>> version 3.1
>> GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
>> N>+++ o K- w---()
>> O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
>> DI+++ D--- G+++>+
>> e+++> h* r++>+++ y++
>> --END GEEK CODE BLOCK--
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] btn-default

2018-03-28 Thread Richard Vézina
Or :

touch /static/css/myapp.css
Then add :

.btn-default {YOUR WANTED STYLE}

Then modify the /views/layout.html and add a new :


response.files.append(URL('static', 'css/myapp.css'))

You don't really want to customize the bootstrap css class or you should
learn "sass" and add another level of abstraction as you have to convert
the sass file into css ...

If you want to go down that road here a starter :
https://www.sitepoint.com/bootstrap-sass-installation-and-customisation/

Richard

On Wed, Mar 28, 2018 at 3:01 PM, Dave S  wrote:

>
>
> On Wednesday, March 28, 2018 at 11:43:00 AM UTC-7, Andrea Fae' wrote:
>>
>> Yes...I know this, but in web2py application I need to change the style.
>> Where is the definition of this class in the files css? Inside the web
>> application I mean...
>>
>>
> grep btn-default */static/js/*.js tells me it is the app's static
> folder.  For instance:
>
> welcome/static/js/web2py-bootstrap3.js:$('form
> input[type="submit"]:not([class^="btn"]), form 
> input[type="button"]:not([class^="btn"])',
> target).addClass('btn btn-default');
>
>  /dps
>
>
>> Il giorno mercoledì 28 marzo 2018 16:50:15 UTC+2, Richard ha scritto:
>>>
>>> Bootstrap : https://getbootstrap.com/
>>>
>>> On Tue, Mar 27, 2018 at 4:02 PM, Andrea Fae'  wrote:
>>>
 Where is the definition btn-default in any welcome clone application? I
 need to change the style...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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

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

-- 
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] btn-default

2018-03-28 Thread Dave S


On Wednesday, March 28, 2018 at 11:43:00 AM UTC-7, Andrea Fae' wrote:
>
> Yes...I know this, but in web2py application I need to change the style. 
> Where is the definition of this class in the files css? Inside the web 
> application I mean...
>
>
grep btn-default */static/js/*.js tells me it is the app's static folder.  
For instance:

welcome/static/js/web2py-bootstrap3.js:$('form 
input[type="submit"]:not([class^="btn"]), form 
input[type="button"]:not([class^="btn"])', target).addClass('btn 
btn-default');

 /dps


> Il giorno mercoledì 28 marzo 2018 16:50:15 UTC+2, Richard ha scritto:
>>
>> Bootstrap : https://getbootstrap.com/
>>
>> On Tue, Mar 27, 2018 at 4:02 PM, Andrea Fae'  wrote:
>>
>>> Where is the definition btn-default in any welcome clone application? I 
>>> need to change the style...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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


Re: [web2py] btn-default

2018-03-28 Thread Andrea Fae'
Yes...I know this, but in web2py application I need to change the style. 
Where is the definition of this class in the files css? Inside the web 
application I mean...


Il giorno mercoledì 28 marzo 2018 16:50:15 UTC+2, Richard ha scritto:
>
> Bootstrap : https://getbootstrap.com/
>
> On Tue, Mar 27, 2018 at 4:02 PM, Andrea Fae'  > wrote:
>
>> Where is the definition btn-default in any welcome clone application? I 
>> need to change the style...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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[web2py] updating pydal in web2py from git repo

2018-03-28 Thread Yoel Benítez Fonseca

h!

How long takes the changes from pydal to be in the web2py git repo... 
following the README.md from web2py:



git clone --recursive https://github.com/web2py/web2py.git


This is OK, but now it need a change already in the master granch of 
pydal, ¿how can i update the pydal submodule?


--
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 "'utf-8' codec can't decode..." when inserting a blob in database (python 3.6.3)

2018-03-28 Thread Massimo Di Pierro
I think this is. Can you please open an issue about it?

On Tuesday, 27 March 2018 13:32:15 UTC-5, alexandre.he...@gmail.com wrote:
>
> Hello All,
>
> I'm an absolute newbie with web2py so I'm not sure if the issue lies in 
> web2py/3.6 or my own mistakes... My apologies in advance.
>
> I encounter this error in a db.my_table.update_or_insert(..)
>
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 96328: 
> invalid start byte'
>
>
> What I'm trying to do:
> I have a text file that is the representation of a datamodel in a specific 
> COTS format.
> I want to parse it, list the tables to be created and create them actually.
> I know that the file countains non-utf-8 characters, that's why I open it 
> in binary:
>
>dpm_file = gzip.open(filepath,'rb')
>
> ... parse it using binary regex: (I imported the 'regex' module)
> regexp = regex.compile(b':columns 
> (\(((?>[^()]+)|(?1))*\))',regex.DOTALL)
> header_classes = regexp.findall(one_format_text)[0]
>
> ... and insert the results in db blob fields: (the error occurs here)
> db.dpm_header.update_or_insert(db.dpm_header.dpm == my_dpm_id, dpm = 
> my_dpm_id, header_classes  = header_classes, header_objects  = 
> header_objects)
>
> I defined blob fields because I thought that it was the way to write 
> directly in binary in database.
> I really wanted to use binary preciselly to avoid to manage the 
> encoding/decoding issues.
>
> In addition, this project is an attempt to transport in web2py an older 
> project that was working perfectly in pure python 3.6.3 (unix and windows) 
> (except that instead of creating tables in a DB, I created text files in a 
> filer...).
> Is it a issue on web2py/python 3.6? Or my misunderstanding on database 
> management...
>
> Thank you for your help!
>
> Here is the trace
>
> Traceback (most recent call last):
>   File "D:\web\zz\web2py\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "D:/web/zz/web2py/applications/dpm_manager/controllers/default.py" 
> ,
>  line 175, in 
>   File "D:\web\zz\web2py\gluon\globals.py", line 419, in 
> self._caller = lambda f: f()
>   File "D:\web\zz\web2py\gluon\tools.py", line 3982, in f
> return action(*a, **b)
>   File "D:/web/zz/web2py/applications/dpm_manager/controllers/default.py" 
> ,
>  line 131, in analyze
> header_classes  = header_classes)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 811, in 
> update_or_insert
> record = self(_key)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 565, in 
> __call__
> orderby_on_limitby=False).first()
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 2250, in 
> select
> return adapter.select(self.query, fields, attributes)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\sqlite.py", line 
> 82, in select
> return super(SQLite, self).select(query, fields, attributes)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 762, in select
> return self._select_aux(sql, fields, attributes, colnames)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 741, in _select_aux
> return processor(rows, fields, colnames, cacheable=cacheable)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 305, in parse
> for row in rows
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 302, in 
> self._parse(
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 231, in _parse
> value = self.parse_value(value, fit, ft, blob_decode)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
> 198, in parse_value
> return self.parser.parse(value, field_itype, field_type)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
> 101, in parse
> return self.registered[field_itype](value, field_type)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
> 76, in __call__
> return self.call(value, field_type)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
> 73, in _call
> return self.f(self.parser, value)
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\base.py", line 37, 
> in _blob
> return to_native(b64decode(to_bytes(value)))
>   File "D:\web\zz\web2py\gluon\packages\dal\pydal\_compat.py", line 82, in 
> to_native
> return obj.decode(charset, errors)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 96328: 
> invalid start byte
>
>

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

[web2py] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-28 Thread Massimo Di Pierro
Good work. This helps me a lot.

On Friday, 23 March 2018 14:07:26 UTC-5, marco mansilla wrote:
>
> Just in case anyone is interested I have uploaded a simple test app with 
> VueJS as modules in the browser.
>
> Did it to test and see how it works, as a demo someone could find it 
> useful, more info in the readme file.
>
> https://github.com/marcomansilla/yava
>
> Opinions are always welcome and appreciated.
>
> -- 
> -BEGIN GEEK CODE BLOCK-
> version 3.1
> GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+ 
> N>+++ o K- w---() 
> O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++> 
> DI+++ D--- G+++>+ 
> e+++> h* r++>+++ y++ 
> --END GEEK CODE BLOCK--
>

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


Re: [web2py] Re: please help us test trunk web2py

2018-03-28 Thread Massimo Di Pierro
can you please provide the final traceback from the erro ticket?

On Sunday, 18 March 2018 02:40:20 UTC-5, Paolo wrote:
>
> @nbush would you open an issue on https://github.com/web2py/web2py/issues. 
> It seems that languages files were wrongly updated into decoded messages. 
> see 
> https://github.com/web2py/web2py/commit/9263f8c4c3be7dd3ac0d1e9948c23b52f10db0d0#diff-59abf7aaebbac65b540eaebf36870ec6
>
>  Paolo
>
> 2018-03-11 20:45 GMT+01:00 Nbush :
>
>> @Paolo
>> in apps welcome
>> in models/db.py add
>>
>> T.force('ru')
>>
>> go admin db
>>
>> ../welcome/appadmin/select/db?query=db.auth_user.id>0
>>
>> oops
>> Internal errorTicket issued: 
>> welcome/178.176.112.38.2018-03-11.19-36-21.63a51c38-0dec-4c13-aa02-3bf882b632e5
>>  
>> 
>>
>> If the browser language is English, everything works fine
>>
>>
>> воскресенье, 11 марта 2018 г., 13:47:04 UTC+3 пользователь Paolo написал:
>>
>>> @nbush, could you post a code snippet to reproduce the error? Which 
>>> web2py version have you tested?
>>>
>>> On Wednesday, March 7, 2018 at 11:31:14 PM UTC+1, Nbush wrote:

 Pluralizaiton error. (test on python 2.7.13)

  'ascii' codec can't decode byte 
 0xd0 in position 0: ordinal not in range(128)
 Function argument list

 (self=, 
 message='%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]} 1 
 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}', symbols=(1,))
 Code listing

 929.
 930.
 931.
 932.
 933.
 934.

 935.
 936.
 937.
 938.

 part = regex_plural_dict.sub(sub_dict, s)
 if part == s:
 return m.group(0)
 return part
 message = message % symbols
 message = regex_plural.sub(sub_plural, message)

 return message

 def translate(self, message, symbols):
 """

 Variables
 message '%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]} 
 1 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}'
 global regex_plural <_sre.SRE_Pattern object>
 regex_plural.sub 
 sub_plural 

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

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


[web2py] Re: Correct way to put libraries in site-package folder?

2018-03-28 Thread Massimo Di Pierro
You can only use the web2py binary with the prepackaged libraries and some 
pure python packages.
If you need to use thrd party libraries that may come to binary form, you 
should use the regular source version of web2py.


On Saturday, 17 March 2018 00:25:55 UTC-5, Jaison Raj wrote:
>
> Hi Anthony,
>
> Yes i have empty __init__.py files in each folders.
> I tried to use "import xml.etree.ElementTree as ET". (instead of 
> cElementTree) it works.
>
> Now i am having problem importing another library: Plotly
>
> the trace back as follows;
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
>
> Traceback (most recent call last):
>   File "D:\2. Projects\Web2Py\2_MULA_2_0\web2py\gluon\restricted.py", line 
> 219, in restricted
> exec(ccode, environment)
>   File 
> "c:/web2py/applications/MULA_2_0\compiled\controllers.cell_reselection.index.py",
>  line 3, in 
>   File "D:\2. Projects\Web2Py\2_MULA_2_0\web2py\gluon\custom_import.py", line 
> 104, in custom_importer
> raise ImportError(e1, import_tb)  # there an import error in the module
> ImportError: (ImportError(ImportError(ImportError('cannot import name 
> exceptions',), ),  0x0875BE18>), )
>
>
> I even copied everything from my C:\Python27\Lib\site-packages to. ... 
> web2py\site-packages, still no luck.
>
> Is web2py binary limited to import certain type of libraries only?
>
>
> Please advise.
>
>
> Regards,
>
> Jaison
>
>
> On Friday, 16 March 2018 23:00:56 UTC+8, Anthony wrote:
>>
>> Do you have empty __init__.py files inside those two subfolders?
>>
>> On Friday, March 16, 2018 at 6:34:02 AM UTC-4, Jaison Raj wrote:
>>>
>>> Hi, 
>>> I am trying to create a binary application (after compiling and 
>>> packaging from windows).
>>> In my controller, i am importing a library :"import 
>>> xml.etree.cElementTree as ET".
>>> I placed the files cElementTree.py and cElementTree.pyc in etree folder 
>>> as follows:
>>> \web2py\site-packages\xml\etree.
>>>
>>> I am getting error: 
>>>  No module named cElementTree.
>>>
>>> How can i solver this error?
>>> Pls advice.
>>>
>>>
>>> Regards,
>>> Jaison
>>>
>>

-- 
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, redirects, and multiple apps

2018-03-28 Thread Massimo Di Pierro
This is all very strange since web2py uses different cookie names, session 
id, and session folders for different apps. Therefore I do not see how 
things can get mixed up.
The only thing I can think of is if something in routes is accidentally 
redirecting form app1 to app2 or vice versa. This would not still not cause 
any session mixed up but it may cause you to see the profile of app1 while 
you think you are seeing the profile of app2 (assuming you were logged in 
both).

Can you email me your routes.py? Also, it there any way I can try this 
myself or reproduce it?

massimo




On Thursday, 15 March 2018 21:17:40 UTC-5, Dave S wrote:
>
> I have a server with one web2py instance  (fronted by nginx/uwsgi), two 
> apps, and a routes.py that says app1 is default.
>
> I recently (that is, last night) added a new function to app2, protected 
> (as usual) with @auth.requires_membship('innercircle').  In addition, I had 
> to create a new user 'goodguy' and add it to 'innercircle'.  I tested from 
> a browser instance that also had routine use of app1.   I spent a lot of 
> time that was supposed to be for testing the form in trying to get logged 
> in correctly.  I eventually tried .../user/profile, and found I was not 
> getting logged in as 'goodguy', I was getting logged in as 'ordinaryjoe', 
> an id that existed in both app1 and app2 (independent DBs, both sqlite3).  
> Also, even though I was specifying 'host:app2/default/newfunc,' I was being 
> redirected to 'host:user/login?next=newfunc', which looks like (when login 
> doesn't fail) it ends up trying to find newfunc in app1.  Being explicit 
> about 'host:/app2/default/user/login?next=app2/default/newfunc' didn't seem 
> to help.
>
> I finally opened a tab in a different browser, and was able to get to the 
> right place, but it seemed like a lot of Sturm und Drang by that time.  For 
> the record, server web2py 2.15.4, python 2.7.13, aws linux; clients Firefox 
> 58.0.2, Chrome 63.0.3239.132, on W10. Also, the successful effort was on 
> Chrome, and today I used the dev tools to record the network activity for 
> the form submit (I'm preparing to use curl to submit the form), and I could 
> see from the request headers that there was session id cookie for both app1 
> and app2 (yes, I've used app1 on that browser, also).
>  
> Should I be doing something in routes.py to make all this work better, or 
> are the user functions problematic in the 1x web2py 2x apps scenario, or 
> was I just a victim of browser caches?
>
> Dave S
> /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] btn-default

2018-03-28 Thread Richard Vézina
Bootstrap : https://getbootstrap.com/

On Tue, Mar 27, 2018 at 4:02 PM, Andrea Fae'  wrote:

> Where is the definition btn-default in any welcome clone application? I
> need to change the style...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.
>

-- 
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] execute python script

2018-03-28 Thread Richard Vézina
It depends...

This is a start if you want to create CSV type of file :

```python
# The code below is greatly inspired by gluon/sqlhtml.py class ExporterTSV
and ExporterCSV
import cStringIO
out = cStringIO.StringIO()
final = cStringIO.StringIO()
import csv
if csv_or_xls == 'csv':
label = 'CSV'
file_ext = 'csv'
content_type = "text/csv"
writer = csv.writer(out, delimiter=',')
elif csv_or_xls == 'tsv':
label = 'TSV'
file_ext = 'csv'
content_type = "text/tab-separated-values"
writer = csv.writer(out, delimiter='\t')
import codecs
final.write(codecs.BOM_UTF16)
for row in transposed_rows:
writer.writerow([unicode(str(cell).decode('utf8')).encode("utf8")
for cell in row])
data = out.getvalue().decode("utf8")
data = data.encode("utf-16")
data = data[2:]
final.write(data)
out.truncate(0)
response.headers['Content-Type'] = content_type
response.headers['Content-Disposition'] = \
'attachment;filename=report_%s.%s;' %
(request.now.strftime('%Y-%m-%d_%H-%M-%S-%f'), file_ext)
response.write(final.getvalue(), escape=False)
raise HTTP(200, str(final.getvalue()), **response.headers)
```

It will differ for PDF, you can have a look in gluon/sqlhtml.py

This is mostly the part to you need to stream your file once it ready, you
have some other things to do before you get there as to determine what you
pdf report should contains (dinamically??).

For the button part it should be as simple as adapt this snippet in a
controller :

export_button_csv = A(I('', _class='icon-download'), CAT('  '), T('Export
CSV'),
  _href=URL(f='export_report', args=request.args(0),
vars=dict(VARS YOU WANT TO PASS TO YOUR
EXPORT FUNCTION TO MAKE IT BEHAVE IN SOME WAY YOU EXPECT...),
),
  _class='btn btn-small')

You then use export_button_csv in your view to display the button...

You have to encapsulate the previsous streaming code in a controller
function that you are going to call export_report (you can change the name
obviously)

Good luck

Richard

On Wed, Mar 28, 2018 at 8:27 AM, ArtDijk  wrote:

> LS,
> I've written a print to pdf python script. How can I execute this script
> via a button on a web2py screen?
>
> --
> 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] execute python script

2018-03-28 Thread ArtDijk
LS,
I've written a print to pdf python script. How can I execute this script 
via a button on a web2py screen?

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