Re: [web2py] Re: Do not redirect to URL ("default", "user", args = "login") when login fails ...

2017-06-09 Thread Junior Phanter
Thank you. It worked!
:)


2017-06-09 19:58 GMT-03:00 Anthony :

> You need to specify the controller when initializing Auth:
>
> Auth_phanterimages = Auth(db_phanterimages, controller='phanterimages',
>   host_names=myconf.get('host.names'))
>
> If you do that, you also don't have to bother with all of those URL
> settings, as they will automatically be constructed properly based on the
> new controller. Note, you can also specify a custom function via the
> "function" argument.
>
> Anthony
>
>
> On Friday, June 9, 2017 at 4:22:46 PM UTC-4, Junior Phanter wrote:
>>
>> Sorry my bad english.
>>
>> Guys, I need to change the login functions ("default/user") to another
>> controller "phanterimages". I did:
>>
>>
>> on model:
>>
>> import os
>>
>> myconf_phanterimages = AppConfig(reload=True)
>> db_phanterimages = DAL(myconf_phanterimages.get('db_phanterimages.uri'),
>>  pool_size=myconf.get('db_phanterimages.pool_size'),
>>  migrate_enabled=myconf.get('db_phanterimages.migrate'),
>>  check_reserved=['all'])
>>
>> Auth_phanterimages = Auth(db_phanterimages, host_names=myconf.get('
>> host.names'))
>>
>> Auth_phanterimages.define_tables(username=False, signature=False)
>> Auth_phanterimages.settings.login_url = URL('phanterimages', 'user',
>> args='login')
>> Auth_phanterimages.settings.logged_url = URL('phanterimages', 'user',
>> args='profile')
>> Auth_phanterimages.settings.login_next = URL('phanterimages', 'index')
>> Auth_phanterimages.settings.logout_next = URL('phanterimages', 'index')
>> Auth_phanterimages.settings.profile_next = URL('phanterimages', 'index')
>> Auth_phanterimages.settings.register_next = URL('phanterimages', 'user',
>> args='login')
>> Auth_phanterimages.settings.retrieve_username_next =
>> URL('phanterimages', 'index')
>> Auth_phanterimages.settings.retrieve_password_next =
>> URL('phanterimages', 'index')
>> Auth_phanterimages.settings.change_password_next = URL('phanterimages',
>> 'index')
>> Auth_phanterimages.settings.request_reset_password_next =
>> URL('phanterimages', 'user', args='login')
>> Auth_phanterimages.settings.reset_password_next = URL('phanterimages',
>> 'user', args='login')
>> Auth_phanterimages.settings.verify_email_next = URL('phanterimages',
>> 'user', args='login')
>>
>> on controller:
>>
>> @Auth_phanterimages.requires_login()
>> def index():
>> """um monte de código"""
>> return locals()
>>
>>
>> def user():
>> """
>> exposes:
>> http:///[app]/default/user/login
>> http:///[app]/default/user/logout
>> http:///[app]/default/user/register
>> http:///[app]/default/user/profile
>> http:///[app]/default/user/retrieve_password
>> http:///[app]/default/user/change_password
>> http:///[app]/default/user/bulk_register
>> use @auth.requires_login()
>> @auth.requires_membership('group name')
>> @auth.requires_permission('read','table name',record_id)
>> to decorate functions that need access control
>> also notice there is http:///[app]/appadmin/manage/auth to allow
>> administrator to manage users
>> """
>> return dict(form=Auth_phanterimages())
>>
>> When I log in, everything is fine, when I log out, too ... everything is
>> working in compliance, the problem is when the login fails (wrong password). 
>> It
>> is redirected to the controller "default" ("it was in 'phanterimages /
>> user'.").
>> Temporarily, until I found another solution. I modified the gluon
>> tools.py file and left it in red:
>>
>> if not user:
>> self.log_event(self.messages['login_failed_log'],
>>request.post_vars)
>> # invalid login
>> session.flash = self.messages.invalid_login
>> #aqui é mensagem do request.flash
>> callback(onfail, None)
>> redirect(URL(request.controller,
>> request.function, args=request.args, vars=request.get_vars),
>> client_side=settings.client_side)
>>
>> Before it was like this:
>>
>>redirect(self.url(args=request.args,
>> vars=request.get_vars), client_side=settings.client_side)
>>
>> Solved my problem, but wanted to know if it's a bug or am I doing
>> something wrong? I searched the internet and found only one user with
>> the same problem in an old post, but the solution that advised him was to
>> go back to the default controller and closed the subject. Someone has a
>> friendlier solution without tampering with gluon 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 

[web2py] Re: Future of web2py

2017-06-09 Thread Ron Chatterjee
No I am saying how fast web3py will be comparing django or flask?

-- 
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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
Yes, two versions are different.  It seems to be the culprit here.  Linux 
has a 2.13.3   version (I think I mentioned it above somewhere).  IIS has 
the latest 2.14.5 on it.  Thanks!

On Friday, June 9, 2017 at 7:01:14 PM UTC-4, Anthony wrote:
>
> On Friday, June 9, 2017 at 4:03:09 PM UTC-4, Seth J wrote:
>>
>> As a matter of fact, I've never specified a table for export control on 
>> any of my other apps written from scratch even on IIS and never had a 
>> problem.  It's just that particular app, for some reason, requires table 
>> name.
>>
>
> No, that's not possible. I think your original code worked with an earlier 
> version of web2py, which may explain the difference between the Linux and 
> Windows machines, but you also said if you created a brand new app on the 
> Windows machine the same code would work, which cannot be the case, as the 
> current version of web2py requires specifying the table names with the 
> exportclasses argument of smartgrid.
>
> 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Anthony
On Friday, June 9, 2017 at 4:03:09 PM UTC-4, Seth J wrote:
>
> As a matter of fact, I've never specified a table for export control on 
> any of my other apps written from scratch even on IIS and never had a 
> problem.  It's just that particular app, for some reason, requires table 
> name.
>

No, that's not possible. I think your original code worked with an earlier 
version of web2py, which may explain the difference between the Linux and 
Windows machines, but you also said if you created a brand new app on the 
Windows machine the same code would work, which cannot be the case, as the 
current version of web2py requires specifying the table names with the 
exportclasses argument of smartgrid.

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: Do not redirect to URL ("default", "user", args = "login") when login fails ...

2017-06-09 Thread Anthony
You need to specify the controller when initializing Auth:

Auth_phanterimages = Auth(db_phanterimages, controller='phanterimages',
  host_names=myconf.get('host.names'))

If you do that, you also don't have to bother with all of those URL 
settings, as they will automatically be constructed properly based on the 
new controller. Note, you can also specify a custom function via the 
"function" argument.

Anthony

On Friday, June 9, 2017 at 4:22:46 PM UTC-4, Junior Phanter wrote:
>
> Sorry my bad english.
>
> Guys, I need to change the login functions ("default/user") to another 
> controller "phanterimages". I did:
>
>
> on model:
>
> import os
>
> myconf_phanterimages = AppConfig(reload=True)
> db_phanterimages = DAL(myconf_phanterimages.get('db_phanterimages.uri'),
>  pool_size=myconf.get('db_phanterimages.pool_size'),
>  migrate_enabled=myconf.get('db_phanterimages.migrate'),
>  check_reserved=['all'])
>
> Auth_phanterimages = Auth(db_phanterimages, 
> host_names=myconf.get('host.names'))
>
> Auth_phanterimages.define_tables(username=False, signature=False)
> Auth_phanterimages.settings.login_url = URL('phanterimages', 'user', 
> args='login')
> Auth_phanterimages.settings.logged_url = URL('phanterimages', 'user', 
> args='profile')
> Auth_phanterimages.settings.login_next = URL('phanterimages', 'index')
> Auth_phanterimages.settings.logout_next = URL('phanterimages', 'index')
> Auth_phanterimages.settings.profile_next = URL('phanterimages', 'index')
> Auth_phanterimages.settings.register_next = URL('phanterimages', 'user', 
> args='login')
> Auth_phanterimages.settings.retrieve_username_next = URL('phanterimages', 
> 'index')
> Auth_phanterimages.settings.retrieve_password_next = URL('phanterimages', 
> 'index')
> Auth_phanterimages.settings.change_password_next = URL('phanterimages', 
> 'index')
> Auth_phanterimages.settings.request_reset_password_next = 
> URL('phanterimages', 'user', args='login')
> Auth_phanterimages.settings.reset_password_next = URL('phanterimages', 
> 'user', args='login')
> Auth_phanterimages.settings.verify_email_next = URL('phanterimages', 
> 'user', args='login')
>
> on controller:
>
> @Auth_phanterimages.requires_login()
> def index():
> """um monte de código"""
> return locals()
>
>
> def user():
> """
> exposes:
> http:///[app]/default/user/login
> http:///[app]/default/user/logout
> http:///[app]/default/user/register
> http:///[app]/default/user/profile
> http:///[app]/default/user/retrieve_password
> http:///[app]/default/user/change_password
> http:///[app]/default/user/bulk_register
> use @auth.requires_login()
> @auth.requires_membership('group name')
> @auth.requires_permission('read','table name',record_id)
> to decorate functions that need access control
> also notice there is http:///[app]/appadmin/manage/auth to allow 
> administrator to manage users
> """
> return dict(form=Auth_phanterimages())
>
> When I log in, everything is fine, when I log out, too ... everything is 
> working in compliance, the problem is when the login fails (wrong password). 
> It 
> is redirected to the controller "default" ("it was in 'phanterimages / 
> user'.").
> Temporarily, until I found another solution. I modified the gluon tools.py 
> file and left it in red:
>
> if not user:
> self.log_event(self.messages['login_failed_log'],
>request.post_vars)
> # invalid login
> session.flash = self.messages.invalid_login  #aqui 
> é mensagem do request.flash
> callback(onfail, None)
> redirect(URL(request.controller, request.function, 
> args=request.args, vars=request.get_vars),
> client_side=settings.client_side)
>
> Before it was like this:
>
>redirect(self.url(args=request.args, 
> vars=request.get_vars), client_side=settings.client_side) 
>
> Solved my problem, but wanted to know if it's a bug or am I doing 
> something wrong? I searched the internet and found only one user with the 
> same problem in an old post, but the solution that advised him was to go 
> back to the default controller and closed the subject. Someone has a 
> friendlier solution without tampering with gluon 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: I have a file 'you.html' in static, how do I open it in my web2py app?

2017-06-09 Thread JoeCodeswell
Hi Mike.

Here's my hack.

*static/anHTMLfile.html*













*
anHTMLfileHELLO from anHTMLfile.html see 
https://groups.google.com/forum/#!topic/web2py/Wqipxb_5-j4;>https://groups.google.com/forum/#!topic/web2py/Wqipxb_5-j4controllers/default.py*












*def showHTMLFile():'''
https://groups.google.com/forum/#!topic/web2py/Wqipxb_5-j4'''import 
oswith open(os.path.join(request.folder, 'static', 'anHTMLfile.html')) 
as x:file_contents = x.read()return 
dict(file_contents=XML(file_contents))views/default/showHTMLfile.html*


*{{=file_contents}}Love and peace,*
*Joe*

On Friday, May 13, 2016 at 8:14:45 AM UTC-7, Mike Stephenson wrote:
>
> I tried the following but it didn't work.
> in controller:
>
> def rough():
> import os
> file = open(os.path.join(request.folder, 'static','index.html'))
> return locals()
>
>
> in view:
>
> {{extend 'layout.html'}}
> {{=file}}
>

-- 
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 not importing global modules

2017-06-09 Thread Darin Williams
That fixed the issue.

On Thursday, June 8, 2017 at 4:17:46 PM UTC-5, Anthony wrote:
>
> Looks like you are using the OSX binary web2py, which includes its own 
> Python interpreter and doesn't see anything in your system installation of 
> Python. Instead, just use the source version of web2py -- binary is only 
> needed if you don't have Python installed.
>
> Anthony
>
> On Thursday, June 8, 2017 at 5:06:38 PM UTC-4, Darin Williams wrote:
>>
>> I am using Web2PY version 2.14.6 on a Mac OS X. I have installed jsonrpc 
>> and pyeapi modules using pip and they are located in 
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
>>  
>> folder. I can use import os without any issues but when I try to import 
>> jsonrpc or pyeapi, it gives the error that it cannot import the module. I 
>> can run command line code and import the modules, so not a permissions 
>> thing. Any help would be appreciated.
>>
>> Version
>> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>> Python Python 2.7.3: /Applications/web2py.app/Contents/MacOS/python 
>> (prefix: /Applications/web2py.app/Contents/Resources)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>>
>> Traceback (most recent call last):
>>   File "/Applications/web2py.app/Contents/Resources/gluon/restricted.py", 
>> line 227, in restricted
>>   File 
>> "/Applications/web2py.app/Contents/Resources/applications/Arista_EOS_Tools/controllers/default.py"
>>  
>> ,
>>  line 13, in 
>>   File "/Applications/web2py.app/Contents/Resources/gluon/custom_import.py", 
>> line 89, in custom_importer
>> ImportError: Cannot import module 
>> 'applications.Arista_EOS_Tools.modules.jsonrpc'
>>
>> Error snapshot [image: help] 
>> 
>>
>> (Cannot import module 
>> 'applications.Arista_EOS_Tools.modules.jsonrpc')
>>
>> inspect attributes
>> Frames
>>
>>- 
>>
>>*File /Applications/web2py.app/Contents/Resources/gluon/restricted.py 
>>in restricted at line 227* code arguments variables
>>- 
>>
>>*File 
>>
>> /Applications/web2py.app/Contents/Resources/applications/Arista_EOS_Tools/controllers/default.py
>>  
>>in  at line 13* code arguments variables
>>- 
>>
>>*File 
>>/Applications/web2py.app/Contents/Resources/gluon/custom_import.py in 
>>custom_importer at line 89* code arguments variables
>>Function argument list
>>
>>(name='jsonrpc', globals={'A': , 'ANY_OF': 
>>, 'ASSIGNJS': , 
>>'AppConfig': , 'Auth': , 
>> 'B': 
>>, 'BEAUTIFY': , 
>> 'BODY': 
>>, 'BR': , 'BUTTON': 
>>, ...}, locals={'A': , 
>>'ANY_OF': , 'ASSIGNJS': >ASSIGNJS>, 'AppConfig': , 'Auth': >'gluon.tools.Auth'>, 'B': , 'BEAUTIFY': >'gluon.html.BEAUTIFY'>, 'BODY': , 'BR': >gluon.html.BR'>, 'BUTTON': , ...}, 
>>fromlist=[], level=-1)
>>Code listing
>>
>>84.
>>85.
>>86.
>>87.
>>88.
>>89.
>>
>>90.
>>91.
>>92.
>>93.
>>
>>new_mod = base_importer(
>>modules_prefix, globals, locals, [itemname], 
>> level)
>>try:
>>result = result or 
>> sys.modules[modules_prefix+'.'+itemname]
>>except KeyError, e:
>>raise ImportError, 'Cannot import module %s' 
>> % str(e)
>>
>>modules_prefix += "." + itemname
>>return result
>>else:
>># import like "from x import a, b, ..."
>>
>>Variables
>>
>> Context
>>
>> locals request session response
>> In file: 
>> /Applications/web2py.app/Contents/Resources/applications/Arista_EOS_Tools/controllers/default.py
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>> 35.
>>
>> # -*- coding: utf-8 -*-
>> # this file is released under public domain and you can use without 
>> limitations
>>
>> # -
>> # This is a sample controller
>> # - index is the default action of any application
>> # - user is required for authentication and authorization
>> # - download is for downloading files uploaded in the db (does streaming)
>> # -
>>
>> import os
>> print (os.environ['PYTHONPATH'])
>> import jsonrpc
>> import pyeapi
>> def index():
>> """
>> example action using the internationalization operator T and flash
>> rendered by views/default/index.html or views/generic.html
>>
>>

[web2py] Do not redirect to URL ("default", "user", args = "login") when login fails ...

2017-06-09 Thread Junior Phanter
Sorry my bad english.

Guys, I need to change the login functions ("default/user") to another 
controller "phanterimages". I did:


on model:

import os

myconf_phanterimages = AppConfig(reload=True)
db_phanterimages = DAL(myconf_phanterimages.get('db_phanterimages.uri'),
 pool_size=myconf.get('db_phanterimages.pool_size'),
 migrate_enabled=myconf.get('db_phanterimages.migrate'),
 check_reserved=['all'])

Auth_phanterimages = Auth(db_phanterimages, 
host_names=myconf.get('host.names'))

Auth_phanterimages.define_tables(username=False, signature=False)
Auth_phanterimages.settings.login_url = URL('phanterimages', 'user', 
args='login')
Auth_phanterimages.settings.logged_url = URL('phanterimages', 'user', 
args='profile')
Auth_phanterimages.settings.login_next = URL('phanterimages', 'index')
Auth_phanterimages.settings.logout_next = URL('phanterimages', 'index')
Auth_phanterimages.settings.profile_next = URL('phanterimages', 'index')
Auth_phanterimages.settings.register_next = URL('phanterimages', 'user', 
args='login')
Auth_phanterimages.settings.retrieve_username_next = URL('phanterimages', 
'index')
Auth_phanterimages.settings.retrieve_password_next = URL('phanterimages', 
'index')
Auth_phanterimages.settings.change_password_next = URL('phanterimages', 
'index')
Auth_phanterimages.settings.request_reset_password_next = 
URL('phanterimages', 'user', args='login')
Auth_phanterimages.settings.reset_password_next = URL('phanterimages', 
'user', args='login')
Auth_phanterimages.settings.verify_email_next = URL('phanterimages', 
'user', args='login')

on controller:

@Auth_phanterimages.requires_login()
def index():
"""um monte de código"""
return locals()


def user():
"""
exposes:
http:///[app]/default/user/login
http:///[app]/default/user/logout
http:///[app]/default/user/register
http:///[app]/default/user/profile
http:///[app]/default/user/retrieve_password
http:///[app]/default/user/change_password
http:///[app]/default/user/bulk_register
use @auth.requires_login()
@auth.requires_membership('group name')
@auth.requires_permission('read','table name',record_id)
to decorate functions that need access control
also notice there is http:///[app]/appadmin/manage/auth to allow 
administrator to manage users
"""
return dict(form=Auth_phanterimages())

When I log in, everything is fine, when I log out, too ... everything is 
working in compliance, the problem is when the login fails (wrong password). It 
is redirected to the controller "default" ("it was in 'phanterimages / 
user'.").
Temporarily, until I found another solution. I modified the gluon tools.py 
file and left it in red:

if not user:
self.log_event(self.messages['login_failed_log'],
   request.post_vars)
# invalid login
session.flash = self.messages.invalid_login  #aqui 
é mensagem do request.flash
callback(onfail, None)
redirect(URL(request.controller, request.function, 
args=request.args, vars=request.get_vars),
client_side=settings.client_side)

Before it was like this:

   redirect(self.url(args=request.args, 
vars=request.get_vars), client_side=settings.client_side) 

Solved my problem, but wanted to know if it's a bug or am I doing something 
wrong? I searched the internet and found only one user with the same 
problem in an old post, but the solution that advised him was to go back to 
the default controller and closed the subject. Someone has a friendlier 
solution without tampering with gluon 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: fluctuating session data storage

2017-06-09 Thread Dave S


On Friday, June 9, 2017 at 7:02:48 AM UTC-7, Pierre wrote:
>
> Hi,
>
> Is it ok to store a small fluctuating* (lot's of updates while user is 
> logged-in)* chunk of data into the session or assume db storage is best 
> ?  what's more efficient  in terms of data accessibility, read-write speed, 
> given sessions would use cookie-storage) ?
>

Is this a small piece of data, like a counter, or larger data like an image 
that's being manipulated?  Does it need to be on the server to be used, or 
would local storage be appropriate?

/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: Problems with file uploading using FORM

2017-06-09 Thread Dave S

On Friday, June 9, 2017 at 10:03:57 AM UTC-7, Maurice Ling wrote:
>
> Thanks for your reply, Dave.
>
> However, I don't really get the part on "drag and drop" - do you mean drag 
> and drop the file into the field? Will it work for a text area?
>

It works with an upload field, which is what you need for uploading a 
file.  Part of the story is HTML5, and part is javascript, but it already 
works in web2py with all modern browsers.  The app that expects pictures is 
at home, so I can't look at thumbnails, but I just tested it with another 
app here.  Client was W10 (but should be able to go back to at least XP), 
Firefox 53.0.3, but should work back into the 30s.  To do the test, I 
opened the page with form, switched windows to WinExplorer to select a 
file, left-clicked on the one I chose, and dragged it over the "Browse..." 
button for the upload field.

On  the server side, I log the upload activity (beyond what Rocket puts 
into httpserver.log) which at the moment includes the size of the file and 
the id of upload table row.

/dps

 

> On Friday, 26 May 2017 02:55:50 UTC+8, Dave S wrote:
>>
>>
>>
>> On Thursday, May 25, 2017 at 8:34:44 AM UTC-7, Maurice Ling wrote:
>>>
>>> Hi everyone,
>>>
>>> I am stuck with an issue - please refer to the code below.
>>>
>>> [...]
>>>
>> 5. I will the want to copy the file into application//upload 
>>> folder using shutils (lines 17-25) but the file name will be changed to 
>>> entry.file..
>>> 6. However, this does not work as I get the error that the file is not 
>>> found. 
>>> 7. For debugging, I print the source file name (line 21) and it only 
>>> gave me the file name when I will need the entire file path for 
>>> shutil.copy2() at line 25 to work.
>>> *[...]* 
>>>
>>sourcefile = form.vars.uploadfile.filename
>>>
>>
>>>1. print sourcefile
>>>2. newfile = upload_dir + os.sep + 'entry.file.' + \
>>>3. str(int(random.random()*10)) 
>>>+ \
>>>4. os.path.splitext(sourcefile)[-1]
>>>5. shutil.copy2(sourcefile, newfile)
>>>6. 
>>>
>>> [...]
>>>
>>  
>> A browser won't tell you the path to the file, just the filename.  It's a 
>> security measure.  The shutil.copy2() call can only handle files local to 
>> the server.  If you're using this page locally on the server, then you can 
>> provide the path information through other channels.
>>
>> I do something like this on my home machine, because I'm using my app to 
>> tag my photos.   Currently, I provide a text field on the form to enter 
>> path (separate from filename), but I check that path against a list I keep 
>> in the code.  That limits the amount filesystem exploration someone could 
>> do if they somehow got access to my app.
>> (BTW, drag-and-drop works for getting the filename into its field).
>>
>> /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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
As a matter of fact, I've never specified a table for export control on any 
of my other apps written from scratch even on IIS and never had a problem. 
 It's just that particular app, for some reason, requires table name.

On Friday, June 9, 2017 at 3:49:12 PM UTC-4, Anthony wrote:
>
> Hmm, thought you said you were running the exact same code on both servers 
> as well as in new apps on the Windows server, and the only thing that 
> wasn't working was the packed app moved from Linux to Windows. But looks 
> like your code itself is wrong, so must not have been the same in the other 
> apps.
>
> On Friday, June 9, 2017 at 2:47:20 PM UTC-4, Seth J wrote:
>>
>> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
>> That solved the problem!!!  
>>
>> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>>
>>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>>> number in default.py?
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:

 Can you be more specific?  I thought "title=dict(..." is reference 
 enough?!?! 樂

 On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>
> You need to tell it which table you're referencing:
>
> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
> links=title_links,
>editable=dict(title=True, 
> title_archive=False),
>deletable=dict(title=True, 
> title_archive=False),
>create=dict(title=True, 
> title_archive=False), user_signature=True, details=False,
>showbuttontext=True, paginate=30, 
> maxtextlengths={'title.f_title_desc': 50},
>
> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
> html=False,
>   
> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>divider="»", formname='title_grid')
>
>
> -Jim
>
> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>
>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>> has two tables.  You'll need to create an account (sign up).  After that 
>> you can see this issue in "Title" page (via top menu).  Let me know what 
>> you think and if it works on your end.  I really appreciate it!
>>
>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>
>>> You don't have to share the actual app, just create a minimal 
>>> application that reproduces the problem.
>>>
>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:

 I wish I could do that, but it's government code.  Security issues, 
 etc.  I was just inquiring on how one would troubleshoot something 
 like 
 that?!?!  May be it's related to a theme somehow?!?!


 On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>
> If you'd like, feel free to attach a packed app that exhibits this 
> behavior (it should use SQLite as the db).
>
> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>
>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>> Windows, if you create a new app, again, the export buttons are 
>> properly 
>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>> Windows, the export buttons that were hidden on Linux suddenly 
>> appear on 
>> Windows?
>>
>> I can't think if anything that would cause that behavior, and it 
>> would be hard to diagnose without interacting directly with the 
>> system.
>>
>> Anthony
>>
>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>
>>> That's the thing! There's no difference in my code, apart from 
>>> connecting to different database. Controller and view are exactly 
>>> the same. 
>>> Same behavior is exhibited by all other controllers/views (about 10 
>>> in 
>>> total). 
>>> I am not saying that there's an error in framework. Apps created 
>>> on Win Server installation of web2py hide unneeded export options 
>>> just 
>>> fine. 
>>> It's just this app that was originally done on Linux, 2.13 
>>> web2py, 2.6 python; when packed and installed on Win Server running 
>>> web2py 
>>> does not respond to disabling selected export options. 
>>>
>>> I am at a loss how to even debig this problem?! 路 
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- 

[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
It IS exactly the same! It controlled export just fine with the attached 
code on Linux, but did NOT on Win IIS. It is still a mystery to me and, 
apparently, Jim.

On Friday, June 9, 2017 at 3:49:12 PM UTC-4, Anthony wrote:
>
> Hmm, thought you said you were running the exact same code on both servers 
> as well as in new apps on the Windows server, and the only thing that 
> wasn't working was the packed app moved from Linux to Windows. But looks 
> like your code itself is wrong, so must not have been the same in the other 
> apps.
>
> On Friday, June 9, 2017 at 2:47:20 PM UTC-4, Seth J wrote:
>>
>> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
>> That solved the problem!!!  
>>
>> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>>
>>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>>> number in default.py?
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:

 Can you be more specific?  I thought "title=dict(..." is reference 
 enough?!?! 樂

 On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>
> You need to tell it which table you're referencing:
>
> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
> links=title_links,
>editable=dict(title=True, 
> title_archive=False),
>deletable=dict(title=True, 
> title_archive=False),
>create=dict(title=True, 
> title_archive=False), user_signature=True, details=False,
>showbuttontext=True, paginate=30, 
> maxtextlengths={'title.f_title_desc': 50},
>
> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
> html=False,
>   
> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>divider="»", formname='title_grid')
>
>
> -Jim
>
> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>
>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>> has two tables.  You'll need to create an account (sign up).  After that 
>> you can see this issue in "Title" page (via top menu).  Let me know what 
>> you think and if it works on your end.  I really appreciate it!
>>
>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>
>>> You don't have to share the actual app, just create a minimal 
>>> application that reproduces the problem.
>>>
>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:

 I wish I could do that, but it's government code.  Security issues, 
 etc.  I was just inquiring on how one would troubleshoot something 
 like 
 that?!?!  May be it's related to a theme somehow?!?!


 On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>
> If you'd like, feel free to attach a packed app that exhibits this 
> behavior (it should use SQLite as the db).
>
> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>
>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>> Windows, if you create a new app, again, the export buttons are 
>> properly 
>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>> Windows, the export buttons that were hidden on Linux suddenly 
>> appear on 
>> Windows?
>>
>> I can't think if anything that would cause that behavior, and it 
>> would be hard to diagnose without interacting directly with the 
>> system.
>>
>> Anthony
>>
>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>
>>> That's the thing! There's no difference in my code, apart from 
>>> connecting to different database. Controller and view are exactly 
>>> the same. 
>>> Same behavior is exhibited by all other controllers/views (about 10 
>>> in 
>>> total). 
>>> I am not saying that there's an error in framework. Apps created 
>>> on Win Server installation of web2py hide unneeded export options 
>>> just 
>>> fine. 
>>> It's just this app that was originally done on Linux, 2.13 
>>> web2py, 2.6 python; when packed and installed on Win Server running 
>>> web2py 
>>> does not respond to disabling selected export options. 
>>>
>>> I am at a loss how to even debig this problem?! 路 
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- 

[web2py] Re: Future of web2py

2017-06-09 Thread Anthony

On Friday, June 9, 2017 at 3:39:43 PM UTC-4, Ron Chatterjee wrote:
>
> Rather than 3rd party packages available, I believe one of the most 
> important criteria for any framework is the speed. How web3py compare to 
> django, flask or other framework in terms of speed?
>

You said, "I am guessing speed will be the only motivation to consider in 
going from pathon 2 to python 3." How does that relate to third party 
packages and web3py vs. Django/Flask?

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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Anthony
Hmm, thought you said you were running the exact same code on both servers 
as well as in new apps on the Windows server, and the only thing that 
wasn't working was the packed app moved from Linux to Windows. But looks 
like your code itself is wrong, so must not have been the same in the other 
apps.

On Friday, June 9, 2017 at 2:47:20 PM UTC-4, Seth J wrote:
>
> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
> That solved the problem!!!  
>
> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>
>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>> number in default.py?
>>
>> -Jim
>>
>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>>
>>> Can you be more specific?  I thought "title=dict(..." is reference 
>>> enough?!?! 樂
>>>
>>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:

 You need to tell it which table you're referencing:

 title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
 links=title_links,
editable=dict(title=True, 
 title_archive=False),
deletable=dict(title=True, 
 title_archive=False),
create=dict(title=True, 
 title_archive=False), user_signature=True, details=False,
showbuttontext=True, paginate=30, 
 maxtextlengths={'title.f_title_desc': 50},

 exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
 html=False,
   
 tsv_with_hidden_cols=False, json=False)), orderby=orderby,
divider="»", formname='title_grid')


 -Jim

 On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>
> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
> has two tables.  You'll need to create an account (sign up).  After that 
> you can see this issue in "Title" page (via top menu).  Let me know what 
> you think and if it works on your end.  I really appreciate it!
>
> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>
>> You don't have to share the actual app, just create a minimal 
>> application that reproduces the problem.
>>
>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>
>>> I wish I could do that, but it's government code.  Security issues, 
>>> etc.  I was just inquiring on how one would troubleshoot something like 
>>> that?!?!  May be it's related to a theme somehow?!?!
>>>
>>>
>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:

 If you'd like, feel free to attach a packed app that exhibits this 
 behavior (it should use SQLite as the db).

 On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>
> So, (a) on Linux, the export buttons are properly hidden, (b) on 
> Windows, if you create a new app, again, the export buttons are 
> properly 
> hidden, but (c) if you pack an app from Linux and simply copy it to 
> Windows, the export buttons that were hidden on Linux suddenly appear 
> on 
> Windows?
>
> I can't think if anything that would cause that behavior, and it 
> would be hard to diagnose without interacting directly with the 
> system.
>
> Anthony
>
> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>
>> That's the thing! There's no difference in my code, apart from 
>> connecting to different database. Controller and view are exactly 
>> the same. 
>> Same behavior is exhibited by all other controllers/views (about 10 
>> in 
>> total). 
>> I am not saying that there's an error in framework. Apps created 
>> on Win Server installation of web2py hide unneeded export options 
>> just 
>> fine. 
>> It's just this app that was originally done on Linux, 2.13 
>> web2py, 2.6 python; when packed and installed on Win Server running 
>> web2py 
>> does not respond to disabling selected export options. 
>>
>> I am at a loss how to even debig 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: Future of web2py

2017-06-09 Thread Ron Chatterjee
Rather than 3rd party packages available, I believe one of the most 
important criteria for any framework is the speed. How web3py compare to 
django, flask or other framework in terms of speed?


On Thursday, June 8, 2017 at 10:50:34 AM UTC-4, Anthony wrote:
>
> On Thursday, June 8, 2017 at 10:14:19 AM UTC-4, Ron Chatterjee wrote:
>>
>> Can we have something intermediate to help with the speed meanwhile?  I 
>> am guessing speed will be the only motivation to consider in going from 
>> pathon 2 to python 3.
>
>
> Not sure what you mean. Are you talking about Python 2 vs. 3, or web2py 
> vs. web3py? The coming release of web2py will support Python 3, but there 
> won't be much difference in speed (no new architecture within the 
> framework, so any speed difference will be due solely to general speed 
> differences between Python 2 and 3). On the other hand, web3py will have a 
> new architecture that will make it faster than web2py. I don't think there 
> is any feasible intermediate option between the two.
>
> 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Jim S
Glad to hear.  Doesn't answer the question of why it is different between 
windows and linux, but does get it working.

Have a great weekend.

-Jim

On Friday, June 9, 2017 at 1:47:20 PM UTC-5, Seth J wrote:
>
> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
> That solved the problem!!!  
>
> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>
>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>> number in default.py?
>>
>> -Jim
>>
>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>>
>>> Can you be more specific?  I thought "title=dict(..." is reference 
>>> enough?!?! 樂
>>>
>>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:

 You need to tell it which table you're referencing:

 title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
 links=title_links,
editable=dict(title=True, 
 title_archive=False),
deletable=dict(title=True, 
 title_archive=False),
create=dict(title=True, 
 title_archive=False), user_signature=True, details=False,
showbuttontext=True, paginate=30, 
 maxtextlengths={'title.f_title_desc': 50},

 exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
 html=False,
   
 tsv_with_hidden_cols=False, json=False)), orderby=orderby,
divider="»", formname='title_grid')


 -Jim

 On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>
> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
> has two tables.  You'll need to create an account (sign up).  After that 
> you can see this issue in "Title" page (via top menu).  Let me know what 
> you think and if it works on your end.  I really appreciate it!
>
> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>
>> You don't have to share the actual app, just create a minimal 
>> application that reproduces the problem.
>>
>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>
>>> I wish I could do that, but it's government code.  Security issues, 
>>> etc.  I was just inquiring on how one would troubleshoot something like 
>>> that?!?!  May be it's related to a theme somehow?!?!
>>>
>>>
>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:

 If you'd like, feel free to attach a packed app that exhibits this 
 behavior (it should use SQLite as the db).

 On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>
> So, (a) on Linux, the export buttons are properly hidden, (b) on 
> Windows, if you create a new app, again, the export buttons are 
> properly 
> hidden, but (c) if you pack an app from Linux and simply copy it to 
> Windows, the export buttons that were hidden on Linux suddenly appear 
> on 
> Windows?
>
> I can't think if anything that would cause that behavior, and it 
> would be hard to diagnose without interacting directly with the 
> system.
>
> Anthony
>
> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>
>> That's the thing! There's no difference in my code, apart from 
>> connecting to different database. Controller and view are exactly 
>> the same. 
>> Same behavior is exhibited by all other controllers/views (about 10 
>> in 
>> total). 
>> I am not saying that there's an error in framework. Apps created 
>> on Win Server installation of web2py hide unneeded export options 
>> just 
>> fine. 
>> It's just this app that was originally done on Linux, 2.13 
>> web2py, 2.6 python; when packed and installed on Win Server running 
>> web2py 
>> does not respond to disabling selected export options. 
>>
>> I am at a loss how to even debig 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
That solved the problem!!!  

On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>
> Sorry, I'm not sure what you're referencing...  Can you give me a line 
> number in default.py?
>
> -Jim
>
> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>
>> Can you be more specific?  I thought "title=dict(..." is reference 
>> enough?!?! 樂
>>
>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>>>
>>> You need to tell it which table you're referencing:
>>>
>>> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
>>> links=title_links,
>>>editable=dict(title=True, 
>>> title_archive=False),
>>>deletable=dict(title=True, 
>>> title_archive=False),
>>>create=dict(title=True, 
>>> title_archive=False), user_signature=True, details=False,
>>>showbuttontext=True, paginate=30, 
>>> maxtextlengths={'title.f_title_desc': 50},
>>>
>>> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
>>> html=False,
>>>   
>>> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>>>divider="»", formname='title_grid')
>>>
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:

 Sorry, didn't think of it that way.  I'm attaching a minimal app that 
 has two tables.  You'll need to create an account (sign up).  After that 
 you can see this issue in "Title" page (via top menu).  Let me know what 
 you think and if it works on your end.  I really appreciate it!

 On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>
> You don't have to share the actual app, just create a minimal 
> application that reproduces the problem.
>
> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>
>> I wish I could do that, but it's government code.  Security issues, 
>> etc.  I was just inquiring on how one would troubleshoot something like 
>> that?!?!  May be it's related to a theme somehow?!?!
>>
>>
>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>>
>>> If you'd like, feel free to attach a packed app that exhibits this 
>>> behavior (it should use SQLite as the db).
>>>
>>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:

 So, (a) on Linux, the export buttons are properly hidden, (b) on 
 Windows, if you create a new app, again, the export buttons are 
 properly 
 hidden, but (c) if you pack an app from Linux and simply copy it to 
 Windows, the export buttons that were hidden on Linux suddenly appear 
 on 
 Windows?

 I can't think if anything that would cause that behavior, and it 
 would be hard to diagnose without interacting directly with the system.

 Anthony

 On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>
> That's the thing! There's no difference in my code, apart from 
> connecting to different database. Controller and view are exactly the 
> same. 
> Same behavior is exhibited by all other controllers/views (about 10 
> in 
> total). 
> I am not saying that there's an error in framework. Apps created 
> on Win Server installation of web2py hide unneeded export options 
> just 
> fine. 
> It's just this app that was originally done on Linux, 2.13 web2py, 
> 2.6 python; when packed and installed on Win Server running web2py 
> does not 
> respond to disabling selected export options. 
>
> I am at a loss how to even debig 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Jim S
Sorry, I'm not sure what you're referencing...  Can you give me a line 
number in default.py?

-Jim

On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>
> Can you be more specific?  I thought "title=dict(..." is reference 
> enough?!?! 樂
>
> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>>
>> You need to tell it which table you're referencing:
>>
>> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
>> links=title_links,
>>editable=dict(title=True, 
>> title_archive=False),
>>deletable=dict(title=True, 
>> title_archive=False),
>>create=dict(title=True, title_archive=False), 
>> user_signature=True, details=False,
>>showbuttontext=True, paginate=30, 
>> maxtextlengths={'title.f_title_desc': 50},
>>
>> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
>> html=False,
>>   
>> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>>divider="»", formname='title_grid')
>>
>>
>> -Jim
>>
>> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>>
>>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>>> has two tables.  You'll need to create an account (sign up).  After that 
>>> you can see this issue in "Title" page (via top menu).  Let me know what 
>>> you think and if it works on your end.  I really appreciate it!
>>>
>>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:

 You don't have to share the actual app, just create a minimal 
 application that reproduces the problem.

 On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>
> I wish I could do that, but it's government code.  Security issues, 
> etc.  I was just inquiring on how one would troubleshoot something like 
> that?!?!  May be it's related to a theme somehow?!?!
>
>
> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>
>> If you'd like, feel free to attach a packed app that exhibits this 
>> behavior (it should use SQLite as the db).
>>
>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>>
>>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>>> Windows, if you create a new app, again, the export buttons are 
>>> properly 
>>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>>> Windows, the export buttons that were hidden on Linux suddenly appear 
>>> on 
>>> Windows?
>>>
>>> I can't think if anything that would cause that behavior, and it 
>>> would be hard to diagnose without interacting directly with the system.
>>>
>>> Anthony
>>>
>>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:

 That's the thing! There's no difference in my code, apart from 
 connecting to different database. Controller and view are exactly the 
 same. 
 Same behavior is exhibited by all other controllers/views (about 10 in 
 total). 
 I am not saying that there's an error in framework. Apps created on 
 Win Server installation of web2py hide unneeded export options just 
 fine. 
 It's just this app that was originally done on Linux, 2.13 web2py, 
 2.6 python; when packed and installed on Win Server running web2py 
 does not 
 respond to disabling selected export options. 

 I am at a loss how to even debig 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
Can you be more specific?  I thought "title=dict(..." is reference 
enough?!?! 樂

On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>
> You need to tell it which table you're referencing:
>
> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
> links=title_links,
>editable=dict(title=True, title_archive=False),
>deletable=dict(title=True, 
> title_archive=False),
>create=dict(title=True, title_archive=False), 
> user_signature=True, details=False,
>showbuttontext=True, paginate=30, 
> maxtextlengths={'title.f_title_desc': 50},
>
> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
> html=False,
>   tsv_with_hidden_cols=False, 
> json=False)), orderby=orderby,
>divider="»", formname='title_grid')
>
>
> -Jim
>
> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>
>> Sorry, didn't think of it that way.  I'm attaching a minimal app that has 
>> two tables.  You'll need to create an account (sign up).  After that you 
>> can see this issue in "Title" page (via top menu).  Let me know what you 
>> think and if it works on your end.  I really appreciate it!
>>
>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>
>>> You don't have to share the actual app, just create a minimal 
>>> application that reproduces the problem.
>>>
>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:

 I wish I could do that, but it's government code.  Security issues, 
 etc.  I was just inquiring on how one would troubleshoot something like 
 that?!?!  May be it's related to a theme somehow?!?!


 On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>
> If you'd like, feel free to attach a packed app that exhibits this 
> behavior (it should use SQLite as the db).
>
> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>
>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>> Windows, if you create a new app, again, the export buttons are properly 
>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>> Windows, the export buttons that were hidden on Linux suddenly appear on 
>> Windows?
>>
>> I can't think if anything that would cause that behavior, and it 
>> would be hard to diagnose without interacting directly with the system.
>>
>> Anthony
>>
>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>
>>> That's the thing! There's no difference in my code, apart from 
>>> connecting to different database. Controller and view are exactly the 
>>> same. 
>>> Same behavior is exhibited by all other controllers/views (about 10 in 
>>> total). 
>>> I am not saying that there's an error in framework. Apps created on 
>>> Win Server installation of web2py hide unneeded export options just 
>>> fine. 
>>> It's just this app that was originally done on Linux, 2.13 web2py, 
>>> 2.6 python; when packed and installed on Win Server running web2py does 
>>> not 
>>> respond to disabling selected export options. 
>>>
>>> I am at a loss how to even debig 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: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Jim S
You need to tell it which table you're referencing:

title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
links=title_links,
   editable=dict(title=True, title_archive=False),
   deletable=dict(title=True, title_archive=False),
   create=dict(title=True, title_archive=False), 
user_signature=True, details=False,
   showbuttontext=True, paginate=30, 
maxtextlengths={'title.f_title_desc': 50},
   
exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, html=False,
  tsv_with_hidden_cols=False, 
json=False)), orderby=orderby,
   divider="»", formname='title_grid')


-Jim

On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>
> Sorry, didn't think of it that way.  I'm attaching a minimal app that has 
> two tables.  You'll need to create an account (sign up).  After that you 
> can see this issue in "Title" page (via top menu).  Let me know what you 
> think and if it works on your end.  I really appreciate it!
>
> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>
>> You don't have to share the actual app, just create a minimal application 
>> that reproduces the problem.
>>
>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>
>>> I wish I could do that, but it's government code.  Security issues, etc. 
>>>  I was just inquiring on how one would troubleshoot something like that?!?! 
>>>  May be it's related to a theme somehow?!?!
>>>
>>>
>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:

 If you'd like, feel free to attach a packed app that exhibits this 
 behavior (it should use SQLite as the db).

 On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>
> So, (a) on Linux, the export buttons are properly hidden, (b) on 
> Windows, if you create a new app, again, the export buttons are properly 
> hidden, but (c) if you pack an app from Linux and simply copy it to 
> Windows, the export buttons that were hidden on Linux suddenly appear on 
> Windows?
>
> I can't think if anything that would cause that behavior, and it would 
> be hard to diagnose without interacting directly with the system.
>
> Anthony
>
> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>
>> That's the thing! There's no difference in my code, apart from 
>> connecting to different database. Controller and view are exactly the 
>> same. 
>> Same behavior is exhibited by all other controllers/views (about 10 in 
>> total). 
>> I am not saying that there's an error in framework. Apps created on 
>> Win Server installation of web2py hide unneeded export options just 
>> fine. 
>> It's just this app that was originally done on Linux, 2.13 web2py, 
>> 2.6 python; when packed and installed on Win Server running web2py does 
>> not 
>> respond to disabling selected export options. 
>>
>> I am at a loss how to even debig 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: Problems with file uploading using FORM

2017-06-09 Thread Maurice Ling
Thanks for your reply, Dave.

However, I don't really get the part on "drag and drop" - do you mean drag 
and drop the file into the field? Will it work for a text area?

Please kindly elaborate.

Thank you once again,
Maurice

On Friday, 26 May 2017 02:55:50 UTC+8, Dave S wrote:
>
>
>
> On Thursday, May 25, 2017 at 8:34:44 AM UTC-7, Maurice Ling wrote:
>>
>> Hi everyone,
>>
>> I am stuck with an issue - please refer to the code below.
>>
>> [...]
>>
> 5. I will the want to copy the file into application//upload 
>> folder using shutils (lines 17-25) but the file name will be changed to 
>> entry.file..
>> 6. However, this does not work as I get the error that the file is not 
>> found. 
>> 7. For debugging, I print the source file name (line 21) and it only gave 
>> me the file name when I will need the entire file path for shutil.copy2() 
>> at line 25 to work.
>> *[...]* 
>>
>sourcefile = form.vars.uploadfile.filename
>>
>
>>1. print sourcefile
>>2. newfile = upload_dir + os.sep + 'entry.file.' + \
>>3. str(int(random.random()*10)) + 
>>\
>>4. os.path.splitext(sourcefile)[-1]
>>5. shutil.copy2(sourcefile, newfile)
>>6. 
>>
>> [...]
>>
>  
> A browser won't tell you the path to the file, just the filename.  It's a 
> security measure.  The shutil.copy2() call can only handle files local to 
> the server.  If you're using this page locally on the server, then you can 
> provide the path information through other channels.
>
> I do something like this on my home machine, because I'm using my app to 
> tag my photos.   Currently, I provide a text field on the form to enter 
> path (separate from filename), but I check that path against a list I keep 
> in the code.  That limits the amount filesystem exploration someone could 
> do if they somehow got access to my app.
> (BTW, drag-and-drop works for getting the filename into its field).
>
> /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] fluctuating session data storage

2017-06-09 Thread Pierre
Hi,

Is it ok to store a small fluctuating* (lot's of updates while user is 
logged-in)* chunk of data into the session or assume db storage is best ?  
what's more efficient  in terms of data accessibility, read-write speed, 
given sessions would use cookie-storage) ?

-- 
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: Trying to use a variable as a field name in a table insert

2017-06-09 Thread Anthony
What's wrong with this approach: 
https://groups.google.com/d/msg/web2py/_VsOlcA2qFk/6whMJl8tAwAJ

On Friday, June 9, 2017 at 12:03:00 AM UTC-4, Peter wrote:
>
>
> I see...  
>>
>>  TypeError: some_function() got an unexpected keyword argument 
>> 'parameter_name'
>>
>
>
> I was trying to avoid the if else but if it's the better way, so be it 
> and I have changed the code using a session cookie...
>
> if session.allocations_table_name == 'task': 
>
> db.payment_allocations.insert(payment_ref=payment.id, 
>
>
>
>   task_ref=record.id,
>
>   amount_allocated=allocation)
>
>
> elif session.allocations_table_name == 'invoice':
>
> db.payment_allocations.insert(payment_ref=payment.id,
>
>   invoice_ref=record.id,
>
>   amount_allocated=allocation)
>
> Thanks for talking the time to explain Anthony! 
>
> Peter
>
>
>
>
>
>

-- 
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] SSL Error with Sparkpost api with web2py.exe

2017-06-09 Thread icodk
Sparkpost has simple python api:

from sparkpost import SparkPost
sp = SparkPost('YOUR API KEY')

response = sp.transmissions.send(
use_sandbox=True,
recipients=['some...@somedomain.com'],
html='Hello world',
from_email='t...@sparkpostbox.com',
subject='Hello from python-sparkpost'
)

print(response)


However I get the following error:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:581)

Could be something with the python version  in web2py.exe (I am useing 
 web2py_2_14_06)
Any idea

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

2017-06-09 Thread Jörg Schneider
+1

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