Re: [web2py] Re: web2py Scheduler with Postgres creates idle in transaction connections

2015-02-19 Thread Niphlod
in my environment, I can't see any idle in transaction that's why I patched the scheduler and asked to do that test. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

Re: [web2py] not web2py question - test timezone detection

2015-02-19 Thread Martin Weissenboeck
From Austria: Europe/Berlin (no surprise... :-)) Regards, Martin 2015-02-19 9:57 GMT+01:00 Mirek Zvolský zvol...@seznam.cz: If you want to help, can you access http://praha.alwaysdata.net/testjstz/testjstz and see what this will write in your country? -- for me: Europe/Berlin. Here is

Re: [web2py] not web2py question - test timezone detection

2015-02-19 Thread Niphlod
me too, I live in Italy, so it's correct. On Thursday, February 19, 2015 at 10:01:43 AM UTC+1, mweissen wrote: From Austria: Europe/Berlin (no surprise... :-)) Regards, Martin 2015-02-19 9:57 GMT+01:00 Mirek Zvolský zvo...@seznam.cz javascript:: If you want to help, can you access

[web2py] return javascript alert from contorler without redirection

2015-02-19 Thread Yebach
Hello I have a button for user to export some data from db. If he does not have the right privileges (that is checked on server) I would like to return an alert (possible modal or smth) without redirection after he clicks ok So far I have an alert but user is redirected to an empty page

[web2py] Re: how to use groupby and sum() in query or grid?

2015-02-19 Thread 黄祥
please try : sum_items = db.items.sales.sum() db().select(sum_items, groupby = db.items.country)[sum_items] best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] not web2py question - test timezone detection

2015-02-19 Thread Mirek Zvolský
If you want to help, can you access http://praha.alwaysdata.net/testjstz/testjstz and see what this will write in your country? -- for me: Europe/Berlin. Here is source - my web2py code with jstz library (timezone detect from browser): def testjstz(): return 'htmlhead/headbodyscript src=

[web2py] request.args return __(double underscore) instead of proper unicode character ??

2015-02-19 Thread Mirek Zvolský
I have problem with unicode characters in url in request.args. Most resources recommend to use the percent encoding. http://stackoverflow.com/questions/2742852/unicode-characters-in-urls Example: http://www.utf8-chartable.de/unicode-utf8-table.pl?start=256unicodeinhtml=hexhtmlent=1

[web2py] Web2py freezes when uploading a file greater than IS_LENGTH maxsize

2015-02-19 Thread William Chen
Hi all, *Background:* I have created a file upload form where you can upload any file smaller than 1MB. This is the db field for the file: Field('file1', 'upload', requires = IS_LENGTH(minsize=0, maxsize=1048576, error_message='File is too huge.')), *Problem:* When I try to upload a huge

[web2py] Re: web2py Scheduler with Postgres creates idle in transaction connections

2015-02-19 Thread stingpan
I actually get an error using your trick: Traceback (most recent call last): File gluon/scheduler.py, line 1512, in module main() File gluon/scheduler.py, line 1506, in main utc_time=options.utc_time) File gluon/scheduler.py, line 588, in __init__ self.define_tables(db,

[web2py] open source GIS components

2015-02-19 Thread Serbulent Ocal
Hello, I am new in web2py. Could someone guide me about how to use open source GIS components (geoserver, openlayers, postgresql) with web2py? I would like to develop a web based GIS app with web2py and open source components. Thanks, Serb -- Resources: - http://web2py.com -

[web2py] openlayers java scriptcode and web2py

2015-02-19 Thread Serbulent Ocal
I am new in this group. I am struggling with to put the openlayers java script code to web2py controller (test.py) together. My aim is to combine them and I was wondering how to put them together to show the tiles as base and the map on top of it? test.py: for url in

Re: Re: [web2py] Re: Testing and web2py - especially appadmin

2015-02-19 Thread Vinicius Assef
Hi guys. I've been too busy in the past months and I couldn't focus on web2py.test. I'm planning to getting back to it next month. On Wed, 18 Feb 2015 17:25:11 -0300 Niphlod wrote the idea behind the project was to have BDD done. Vinicius was covering already unittesting. IMHO web

[web2py] Good Practices - Custom Auth (default table) VS. Defining Own Auth Tables (for different user level)

2015-02-19 Thread Jon M.
Peaceful Greetings Web2Py Group! In my first glances of practicing and implementing this awesome framework, came across with some doubts with the *authorization* topic. In general database, server and services good practices, hand to hand with security, What do you think that is the best?

[web2py] is main site hacked?

2015-02-19 Thread Alex Ar
First time looking at web2py. This button could not be generated. Help https://www.coinbase.com/external_redirect?link=https%3A%2F%2Fsupport.coinbase.comsignature=2b3e71a85b300325118665602b21e9470c9ce414The first page contains a semi-hidden fourth button on the right tab, just under sites

[web2py] how to change grid name?

2015-02-19 Thread Oliver Holloway
The smartgrid seems to be taking the name of the table, capitalizing it, and adding es to it, which is funny because the table name is already plural ('programs'). Anyway, how do I set the grid name?

[web2py] Re: How to copy and move a file from the admin interface?

2015-02-19 Thread Massimo Di Pierro
Please open a ticket. We should add the funtionality On Wednesday, 18 February 2015 10:12:45 UTC-6, François Delpierre wrote: Hi, From the admin interface, it's easy to create a new file or to delete it, but how do I move one to an other folder, or just copy an existing one to a new file

[web2py] github wiki?

2015-02-19 Thread Massimo Di Pierro
What do people think about using? https://github.com/web2py/web2py/wiki -- 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

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
uhm, strange. I opened the code and saw this https://github.com/web2py/web2py/blob/master/scripts/sessions2trash.py#L167 I though it worked. Let me test it and I'll get back here ASAP. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: Re: [web2py] Re: Testing and web2py - especially appadmin

2015-02-19 Thread Richard Vézina
I study a bit each of your demo app, and they pretty much use a similar approach. So for making test execution under web2py environnement, I think we are fine... I see flaw in mocking inside web2py (Niphold as some kind of mocking functions), I guess a default mocking module python file could be

[web2py] Re: How to copy and move a file from the admin interface?

2015-02-19 Thread Derek
I thought you could just rename the file and it would move it. ex: file.txt renamed to /static/file.txt would move the file to static. On Thursday, February 19, 2015 at 1:25:48 PM UTC-7, Massimo Di Pierro wrote: Please open a ticket. We should add the funtionality On Wednesday, 18 February

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
you found a bug that seems just a typo. Fixing it works, but not completely: it tries to delete only the parent folder of a session file that got deleted (and quite frankly a bit slow, checking for every file). I'll simplify with an example: the new storage scheme is roughly

[web2py] Re: Web2py freezes when uploading a file greater than IS_LENGTH maxsize

2015-02-19 Thread Willoughby
https://groups.google.com/d/topic/web2py/WatEyE8UwDI/discussion On Thursday, February 19, 2015 at 5:53:45 AM UTC-5, William Chen wrote: Hi all, *Background:* I have created a file upload form where you can upload any file smaller than 1MB. This is the db field for the file:

[web2py] Re: github wiki?

2015-02-19 Thread Niphlod
who's going to be the content manager ? As long as entries are publicly available but the author creating them doesn't maintain them, it's going to have the exact same issues of web2pyslices.com. On Thursday, February 19, 2015 at 9:30:50 PM UTC+1, Massimo Di Pierro wrote: What do people

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
PS: from my humble calculations inside session there can be AT MOST 560 folders that can contain each one 560 folders. it's not that much for a production environment, but I get the argument of keeping the dev environment clean. -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: return javascript alert from contorler without redirection

2015-02-19 Thread Leonel Câmara
This will always go to a new page because you're following a link. You need to make this an ajax call associated with the onclick of the button. Then you can simply use response.flash to use the regular alerts web2py already provides or response.js and you don't even need to return anything

[web2py] Re: return javascript alert from contorler without redirection

2015-02-19 Thread Mirek Zvolský
If you call controller function and return something from this function, it will allways create new page (if you return string, it will be returned directly, if dictionary, it will be returned through the templating engine). You can 1) test privileges before (when you create the page at first)

Re: [web2py] Re: return javascript alert from contorler without redirection

2015-02-19 Thread Vid Ogris
on button click i am returning a file. Should it be any different with it. Also my response.flash or session.flash message is not working.Any ideas why? 2015-02-19 12:47 GMT+01:00 Leonel Câmara leonelcam...@gmail.com: This will always go to a new page because you're following a link. You need

[web2py] Re: not web2py question - test timezone detection

2015-02-19 Thread Leonel Câmara
I got Europe/London Which is correct since Lisbon is in the same timezone as London. -- 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

Re: [web2py] Re: return javascript alert from contorler without redirection

2015-02-19 Thread Vid Ogris
Are you suggesting using ajax button onclick= ajax('{{=URL(script,iCalDownload, args = request.args[0])}}',[], '') class=btn btn-primaryspan class=glyphicon glyphicon-export/spannbsp;nbsp;{{ =T('Export iCal') }}/button because the return from my function is return

[web2py] Re: return javascript alert from contorler without redirection

2015-02-19 Thread Leonel Câmara
That won't work, the easiest way is to use some kind of jquery file download plugin. -- 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

[web2py] Re: how to use groupby and sum() in query or grid?

2015-02-19 Thread Michael Beller
Thank you but I get the following error with that approach: type 'exceptions.TypeError' list indices must be integers, not Expression However, I did get this to work: t = db.items q = t.id0 usum = t.sales.sum() usum.tablename = 'items' usum.readable = True usum.represent

Re: [web2py] Re: Testing and web2py - especially appadmin

2015-02-19 Thread Richard Vézina
Thanks! You maybe right about TDD being less applicable web app... At least in case of controller, for subfunction though input values can be mocked in case of a compute function or a represent function... But doctest maybe enough for that kind of testing... Richard On Wed, Feb 18, 2015 at 3:25

[web2py] Re: not web2py question - test timezone detection

2015-02-19 Thread Dave S
On Thursday, February 19, 2015 at 12:57:50 AM UTC-8, Mirek Zvolský wrote: If you want to help, can you access http://praha.alwaysdata.net/testjstz/testjstz and see what this will write in your country? -- for me: Europe/Berlin. America/Los_Angeles which is correct (I'm 50-ish miles from

[web2py] Re: github wiki?

2015-02-19 Thread Massimo Di Pierro
I agree. what do you propose On Thursday, 19 February 2015 15:14:53 UTC-6, Niphlod wrote: who's going to be the content manager ? As long as entries are publicly available but the author creating them doesn't maintain them, it's going to have the exact same issues of web2pyslices.com.

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
correction, too humble. My analysis degree never came to reality :P it's not 560, it's 3360 On Thursday, February 19, 2015 at 10:12:09 PM UTC+1, Niphlod wrote: PS: from my humble calculations inside session there can be AT MOST 560 folders that can contain each one 560 folders. it's not that

[web2py] Deep linking with components

2015-02-19 Thread Richard
Hello, I may be ignorant, but to me it seems that there is a missing functionnality in components called deep linking in Angularjs world. I start tu use components a lot for end-user data retreiving, you pick an item in one drop box factory form then another and bang you access an updated

[web2py] Re: DAL database adapter only validates datetime on read.

2015-02-19 Thread MDSIII
Thanks, makes sense. And yeah, validate_and_insert() works as documented. On Wednesday, February 18, 2015 at 12:53:32 PM UTC-8, Niphlod wrote: that's pretty much expected: the general rule is that if you want your fields validated at insert level, you shouldn't use insert() but

[web2py] bootstrap 3?

2015-02-19 Thread Michael Lam
Hi, I'm creating a web app by using the welcome app as a template - there's an external theme, HTML, etc. I want to use which seems to be using Bootstrap 3. Web2py had bootstrap3 support sometime in 2014, but it seemed to have been reverted in favour of an early release amid discussion whether

[web2py] Admin Authentication Security

2015-02-19 Thread Tom
I currently have the admin app configured to be only accessible from a single dynamic IP, however I intend to relax this a bit. Prior to doing so I tested the authentication methods by entering false passwords for admin several times. As expected my IP shows up in the hosts.deny file after

[web2py] challenge of the day

2015-02-19 Thread Massimo Di Pierro
say you have a script (for example a python program created with argparse) that lists the options with the -h option. Can you write Python function that takes as input the output of the script and generate a web2py form, parses the form.vars and calls the script with the proper arguments? For

[web2py] Re: github wiki?

2015-02-19 Thread Niphlod
uhm, I propose another POV: what issue does the wiki suggestion needs to solve ? -- 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

[web2py] Re: openlayers java scriptcode and web2py

2015-02-19 Thread Massimo Di Pierro
I am not sure why you are using LOAD and response.js. It seems un-necessary. Also I am not sure it is a good idea to put JS in controllers. Instead I would do: def index(): return dict() def map_data(): return response.json([.]) and have an index.html that includes all the JS

[web2py] Re: how to change grid name?

2015-02-19 Thread Massimo Di Pierro
You are using the generic.html view. That only works in development and it is not a recommended policy in production. It is telling you that you have a variable called grid and displaying the object. You need to make your own view and embed the grid with {{=grid}} so that it won't display the

[web2py] Re: is main site hacked?

2015-02-19 Thread Massimo Di Pierro
No. Apparently coinbase which I used to accept bitcoins has added new policies. On Wednesday, 18 February 2015 17:14:11 UTC-6, Alex Ar wrote: First time looking at web2py. This button could not be generated. Help

[web2py] Re: Good Practices - Custom Auth (default table) VS. Defining Own Auth Tables (for different user level)

2015-02-19 Thread Massimo Di Pierro
I would never recommend splitting auth_user in multiple tables. It just makes everything else more complex. Moreover the roles you describe are not always exclusive and therefore you may end up with duplication of data. On Thursday, 19 February 2015 10:57:32 UTC-6, Jon M. wrote: Peaceful

Re: [web2py] Re: Testing and web2py - especially appadmin

2015-02-19 Thread Richard Vézina
Thanks Mark, I like pytest, it is pretty flexible... Richard On Thu, Feb 19, 2015 at 11:01 AM, Mark Graves mgrave...@gmail.com wrote: You may also consider pytest bdd. Its a pytest plugin that brings in BDD gherkin syntax and executable specifications. A nice complement/alternative to

Re: [web2py] Re: Testing and web2py - especially appadmin

2015-02-19 Thread Mark Graves
You may also consider pytest bdd. Its a pytest plugin that brings in BDD gherkin syntax and executable specifications. A nice complement/alternative to behave. On Thursday, February 19, 2015 at 9:29:19 AM UTC-6, Richard wrote: Thanks! You maybe right about TDD being less applicable web

[web2py] Bug: SQLFORM.accepts() breaks formstyle when widgets are defined

2015-02-19 Thread tim . nyborg
I'm using a custom formstyle to apply bootstrap3 to my forms (a modified copy of the built-in bootstrap3_inline). Importantly, it adds the form-control class to each input. This works fine, until you define a widget for a field, and have it fail validation. db.define_table('test',

[web2py] Re: sessions2trash.py

2015-02-19 Thread Annet
Hi Niphlod, Thanks for your reply. I tested the sessions2trash.py from: https://github.com/web2py/web2py/ The script deletes the sessions but does not delete the folder structure, so the empty folders still pile up. It does return a different output: Last login: Thu Feb 19 12:37:33 on

[web2py] Re: not web2py question - test timezone detection

2015-02-19 Thread Jim S
America/Chicago ...which is correct for me. -Jim On Thursday, February 19, 2015 at 2:57:50 AM UTC-6, Mirek Zvolský wrote: If you want to help, can you access http://praha.alwaysdata.net/testjstz/testjstz and see what this will write in your country? -- for me: Europe/Berlin. Here is