[web2py] Re: AppConfig vs SETTINGS

2015-07-10 Thread 黄祥
also, please take a look at this discussion ref: https://groups.google.com/forum/#!topic/web2py/xl2D_RZfGic best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/li

[web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread 黄祥
please take a look at web2py/gluon/contrib/websocket_messaging.py after that please try it, if still not success, please show the traceback error or your code, so that people in this group can help. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

Re: [web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread Richard Vézina
Oups above forget the name of Static/js file which is : websocket_connected_user.js and there is this file missing : *# Static/js* *# userConnection.js* // NEED DESCRIPTION function userCommunication() { this.ipToranado = ""; this.userId = ""; this.adressServer = ""; this.userConn

[web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread Samuel Sowah
By 'online user' i mean clients that have a websocket connection. On Friday, July 10, 2015 at 7:12:50 PM UTC, JorgeH wrote: > > Hah > > Be patient.. Don't expect other people to answer right away. Rest assured > your question is being read. That doesn't mean that everyone have the > answer at ha

[web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread JorgeH
Hah Be patient.. Don't expect other people to answer right away. Rest assured your question is being read. That doesn't mean that everyone have the answer at hand. I have never done what you need but I am guessing you have to define what an 'online user is' Does it mean users logged in? In t

[web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread Samuel Sowah
I need help please... anyone? This thread keeps going down the list and I'm afraid it might get missing and go unanswered :/ On Friday, July 10, 2015 at 12:20:39 PM UTC, Samuel Sowah wrote: > > I checked out the web2py.js file and it looks like what i'm looking for is > right in there but i rea

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-10 Thread Dave S
On Friday, July 10, 2015 at 10:34:15 AM UTC-7, Dave S wrote: > > > > On Friday, July 10, 2015 at 2:25:26 AM UTC-7, Ramashish Gaurav wrote: >> >> Hello all ! >> >> I ran the scripts for installing apache + web2py + as specified in >> the chapter 29, but a strange behaviour is shown. Suppose

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-10 Thread Dave S
On Friday, July 10, 2015 at 2:25:26 AM UTC-7, Ramashish Gaurav wrote: > > Hello all ! > > I ran the scripts for installing apache + web2py + as specified in > the chapter 29, but a strange behaviour is shown. Suppose my server IP is > a.b.c.d , then I am able to access > a.b.c.d/examples,

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-10 Thread Richard Vézina
Which script? What OS? Which web2py version? If you want more help, you will need to answer at least these questions... :) Richard On Fri, Jul 10, 2015 at 5:25 AM, Ramashish Gaurav wrote: > Hello all ! > > I ran the scripts for installing apache + web2py + as specified in > the chapter

[web2py] Re: JSON and url vars

2015-07-10 Thread Leonel Câmara
My bad I assumed an English locale and that later you would translate. This is starting to look ugly, so it's questionable if it isn't better to just hardcode the months in a list but it would work: {{import datetime}} {{import locale}} {{for m in [datetime.date(2000, m, 1).strftime('%B').deco

[web2py] Re: AppConfig vs SETTINGS

2015-07-10 Thread Leonel Câmara
Because ConfigParser doesn't work like that: https://docs.python.org/2/library/configparser.html -- 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 recei

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2015-07-10 Thread Mark Li
I am currently not using the newest version of web2py; I'll probably update in the near future and add a reminder to look into this. On Mon, Jul 6, 2015 at 10:23 AM, Krzysztof Socha wrote: > > > On Wednesday, December 11, 2013 at 10:01:39 PM UTC+1, Mark Li wrote: >> >> I looked into the code and

[web2py] Re: Really Weird DB Bug?

2015-07-10 Thread Anthony
Are you saying in the case of the post, it inserts two records with the value "test" as the tag name? Can you show the exact test code that works as well as showing the full code for how you submit/post the data as well as the exact value(s) you submit? On Thursday, July 9, 2015 at 7:32:28 PM U

Re: [web2py] Layout.html — Ajax & Direct URL

2015-07-10 Thread Anthony
{{extend}} and {{include}} are not Python code but are template language directives, so they are executed before any Python code is run. As a result, you cannot put an {{extend}} inside a Python "if" block. However, you can do the following: {{extend 'layout.html' if not request.ajax else None}

[web2py] Re: AppConfig vs SETTINGS

2015-07-10 Thread Dmitry Ermolaev
why print myconfig['db']['uri']['any2'] why not use dots? print myconfig.db..url.any2. in Storage it work -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issue

[web2py] How do I tell how many users are connected to a page (websockets)?

2015-07-10 Thread Samuel Sowah
I checked out the web2py.js file and it looks like what i'm looking for is right in there but i really do not know how to implement this. I realized I can take advantage of the web2py_websocket function's onopen argument and write a function to tell that that user is online, and when the browser

[web2py] AppConfig vs SETTINGS

2015-07-10 Thread Dmitry Ermolaev
new: in /private new file myconf = AppConfig(reload=True) if not request.env.web2py_runtime_gae: ## if NOT running on Google App Engine use SQLite or other DB db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all']) old: in /model 0.

[web2py] Re: JSON and url vars

2015-07-10 Thread Carla Raquel
This piece of code throws me some unicode problems on "Março". I've searched for a solution but didn't find one. {{for m in [datetime.date(2000, m, 1).strftime('%B') for m in range(1, 13 )]:}} {{=m}} {{pass}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

Re: [web2py] Re: New feature in trunk: API tokens

2015-07-10 Thread Pablo Angulo
Sorry, I see signing the email scrambled the patch: > diff --git a/applications/welcome/controllers/default.py > b/applications/welcome/controllers/default.py > index c775603..e99ef0f 100644 > --- a/applications/welcome/controllers/default.py > +++ b/applications/welcome/controllers/default.py > @

Re: [web2py] Layout.html — Ajax & Direct URL

2015-07-10 Thread PRACHI VAKHARIA
Dear SK, That is a possible solution, but I feel that it is not *the most elegant way* to do it, since it involves creating more files leading to redundancy – and difficult to maintain as files number increases. My intended approach overcomes that with half the number of View files using

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-10 Thread Ramashish Gaurav
Hello all ! I ran the scripts for installing apache + web2py + as specified in the chapter 29, but a strange behaviour is shown. Suppose my server IP is a.b.c.d.e , then I am able to access > a.b.c.d/examples, whereas when I try to access > a.b.c.d/welcome or a.b.c.d/admin, it throws a ti

Re: [web2py] Layout.html — Ajax & Direct URL

2015-07-10 Thread Selman Kocael
you can write two view. 1. view.html - direct request, extends layout.html 2. view.load - load via ajax. only requested information, not extends layout or footer etc. for example: view.load {{for i in range(0,9):}} {{=i}} {{pass}} view.html {{extend 'Layout.html'}} # other things {{=LOAD(

Re: [web2py] Re: New feature in trunk: API tokens

2015-07-10 Thread Pablo Angulo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 > diff --git a/applications/welcome/controllers/default.py b/applications/welcome/controllers/default.py > index c775603..e99ef0f 100644 > --- a/applications/welcome/controllers/default.py > +++ b/applications/welcome/controllers/default.py > @@ -57

Re: [web2py] Layout.html — Ajax & Direct URL

2015-07-10 Thread Selman Kocael
try LOAD component: http://www.web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD 2015-07-10 10:24 GMT+03:00 PRACHI VAKHARIA : > > > > > *GOAL* > > >- *AJAX — *controller/function is accessed via Ajax, update the div#ID >content only. (When a user clicks a link, a URL is g