[web2py] Re: one-to-many relations and form for crerate records

2014-08-20 Thread Cliff Kachinske
Here is what I would do. On the client have a var contact_count = 0 All of your starting contact fields will have a suffix "__0" When the user clicks the add contact button, use Javascript to increment the contact_count and write another set of contact fields. This time set the suffix to "__1"

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Cliff Kachinske
The install script in the book may not be correct for your version of Web2py. A good first step might be to check the script's config settings against the ones from the book. On Wednesday, August 20, 2014 4:49:28 PM UTC-4, Jim S wrote: > > I did this and after waiting 45 minutes and re-testing,

[web2py] Re: How to use user_bar() in Welcome app - custom login menu navbar

2014-08-20 Thread Rob_McC
Thanks for help guys. I think I must have added that to default.py at some point, while trying to learn to cusomize a navbar http://127.0.0.1:8000/admin/default/edit/welcome/controllers/default.py Sorry for confusion. At any rate,I took Massimo's suggestion, and coded the navbar in html. I

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Jim S
I did this and after waiting 45 minutes and re-testing, it did not exhibit the slow behavior. Since this is a test without running nginx/uwsgi I'm assuming my problem is in one of those layers. Also, I access the production site with http instead of https, the slowness isn't there either. -Ji

[web2py] Re: Unable to connect to MSSQL via web2py - SSL Security Error

2014-08-20 Thread Niphlod
uhm. connecting to "localhost" and from outside can require very different handshakes. For what is worth, I work daily with 2014 and I can connect fine (as long as the odbc driver is there). Your error seems to pinpoint to SSL security needed to connect to that host. Before jumping in that ship

[web2py] Re: scheduler causing mariadb deadlocks

2014-08-20 Thread Niphlod
well, you're definitely a power-user if you're submitting 1000 tasks/minute. If you're using a high number of workers you're a perfect candidate for a new incarnation of the scheduler (yet to come, but it's going to be "actual" soon) that uses redis as the coordinator instead of the scheduler_wo

[web2py] Re: Scheduler task finishes but row not marked COMPLETED

2014-08-20 Thread Niphlod
you have very weird logging prefixes it doesn't seem you're doing something wrong (that's just because you didn't past ANY code to support you) but I'd like to see the "surrounding" lines of the scheduler log. If it's too long just attach it. On Wednesday, August 20, 2014 3:33:41 PM UTC+2,

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Jim Steil
Niphold - I didn't do any configuration of uwsgi other than what comes with the script from the book. Richard - What will the profiler tell me? I've never used it before? How do I read the output? -Jim On Wed, Aug 20, 2014 at 2:38 PM, Niphlod wrote: > seems to me that the problem could be u

[web2py] Re: DAL insert(): ID increases even after rollback()

2014-08-20 Thread Niphlod
it's not a bug per se. Call it as you like, integer PK, autoincrement, identity, etc etc types are made not to be strictly sequential. They just needs to assure that the number that comes up is not yet in the table. On Wednesday, August 20, 2014 8:34:05 PM UTC+2, Anthony wrote: > > Looks like

[web2py] Re: one-to-many relations and form for crerate records

2014-08-20 Thread Alex
For dynamic pages I'd recommend to use a javascript framework. When the user submits the form you make an ajax call to your 'save' controller where you verify the data (this can be done with form.accepts) and return possible errors. I'm rewriting many pages with knockout ( http://knockoutjs.c

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Niphlod
seems to me that the problem could be uwsgi not being active at the time the first request comes in how did you configured it ? On Wednesday, August 20, 2014 9:26:35 PM UTC+2, Richard wrote: > > You can check that with profiler : python web2py.py -a 'asdf' -i 127.0.0.1 > -p 8000 appname -F f

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Richard Vézina
You can check that with profiler : python web2py.py -a 'asdf' -i 127.0.0.1 -p 8000 appname -F fileNameForProfilerDumpInfo' Your app will be very slow with profiler. Richard On Wed, Aug 20, 2014 at 3:24 PM, Richard Vézina wrote: > Could your app take time to create global vars and after they a

Re: [web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Richard Vézina
Could your app take time to create global vars and after they are cached up? Richard On Wed, Aug 20, 2014 at 1:32 PM, Jim S wrote: > Hi > > I've installed web2py on my ubuntu machine using the script at the bottom > of this section in the book: > > http://web2py.com/books/default/chapter/29/13

[web2py] Re: DAL insert(): ID increases even after rollback()

2014-08-20 Thread Anthony
Looks like the expected behavior: http://bugs.mysql.com/bug.php?id=6714 Anthony On Wednesday, August 20, 2014 11:03:29 AM UTC-4, Jan Beilicke wrote: > > > Hi all, > > since a long time I'm working on a web2py project again. And it was about > time! ;) > > While trying to refresh my mind, I was

Re: [web2py] Re: Bad url decode %2B

2014-08-20 Thread Roberto Perdomo
Thanks Massimo El ago. 20, 2014 1:41 PM, "Massimo Di Pierro" escribió: > yes. web2py does not like spaces in the URL. If you want you can get the > request.raw_args before they are parsed. > > On Tuesday, 19 August 2014 22:30:37 UTC-5, Roberto Perdomo wrote: >> >> Hi everybody, >> >> I have a URL

[web2py] Re: Content-Type does not get set for response.stream method

2014-08-20 Thread Anthony
Is file_path an actual file path, or is it a file-like object? On Wednesday, August 20, 2014 9:43:14 AM UTC-4, Kuba Kozłowicz wrote: > > from applications.ChartGenerator.modules import generator > from gluon import HTTP, contenttype > > #URL > def generate(): > if request.env.request_method ==

[web2py] Re: websocket ssl

2014-08-20 Thread Massimo Di Pierro
websocket_messaging.py uses tornado. You need to look in the tornado docs. On Tuesday, 19 August 2014 09:36:21 UTC-5, Maciej S wrote: > > Is it possible to run websocket server > (web2py/gluon/contrib/websocket_messaging.py) with ssl support, how to do > it? > > Thank you for reply. > -- Resou

[web2py] Re: web2.py + mpld3: how to display the generated HTML

2014-08-20 Thread Anthony
{{=XML(make_html)}} Anthony On Wednesday, August 20, 2014 6:19:54 AM UTC-4, Stavros Anastasiadis wrote: > > I am trying to use mpld3 (http://mpld3.github.io/index.html) to generate > an example plot with web2py. > > so far in my simple example: > > controller: > > def example_plot(): > impo

[web2py] Re: I don't have a gluon forder in my web2py folder

2014-08-20 Thread Massimo Di Pierro
Do you have the windows or the mac binary? On Monday, 18 August 2014 05:24:18 UTC-5, Joe wrote: > > I just noticed that I don't have a gluon folder in the web2py folder. > Everything seems to work fine, but as I just watched the tutorial video > going through each folder, I realized that I don't

[web2py] Re: Requirements per application

2014-08-20 Thread Massimo Di Pierro
Yes. you put them in application//modules/ and then each app will import from there. Some modules break when you do this. If it happens bring it up here and we can tell you how to fox them. On Monday, 18 August 2014 03:45:34 UTC-5, Kuba Kozłowicz wrote: > > I would like to know if it is possible

[web2py] Re: putting in a custom render function with T.M()

2014-08-20 Thread Massimo Di Pierro
Can you show us your code. On Wednesday, 20 August 2014 10:06:19 UTC-5, Calvin wrote: > > Hi > > I am wondering if it is possible to customise the render function within a > ``code`` segment with T.M(). I have tried adding the extra keyword as > documented in the Markmin documentation but this i

[web2py] Re: Bad url decode %2B

2014-08-20 Thread Massimo Di Pierro
yes. web2py does not like spaces in the URL. If you want you can get the request.raw_args before they are parsed. On Tuesday, 19 August 2014 22:30:37 UTC-5, Roberto Perdomo wrote: > > Hi everybody, > > I have a URL with a encoded string as first argument, when this string > have a "+", web2py g

[web2py] Content-Type does not get set for response.stream method

2014-08-20 Thread Kuba Kozłowicz
from applications.ChartGenerator.modules import generator from gluon import HTTP, contenttype #URL def generate(): if request.env.request_method == 'POST': import gluon.contrib.simplejson try: data = gluon.contrib.simplejson.loads(request.body.read()) fi

[web2py] Scheduler task finishes but row not marked COMPLETED

2014-08-20 Thread Stephen Weiss
I have a scheduled task firing off that goes through its process and finishes. The following is output from the web2py-scheduler log file, which indicates that the task should be marked completed. DEBUG:Tool:tasks.py:deploy_project: Done DEBUG:Tool:tasks.py:deploy: Done DEBUG:Tool:tasks.py:

[web2py] Rendering rows using represent

2014-08-20 Thread Pedro
I am using mongo with example tables: db.define_table('domain', Field('name', 'string'), format='%(name)s' ) db.define_table('whois', Field('domain_id', 'reference domain', represent=lambda id, r: '%s' % (db.domain(id).name)),

[web2py] Re: using FORM with new line layout

2014-08-20 Thread Kirill Shatalaev
You are on the wrong way, if you want to do this in the *controller*. Due to MVC, you have to customize your form's appearance in your *view* понедельник, 18 августа 2014 г., 2:37:22 UTC+4 пользователь sid datta написал: > > > HI - I wanted to customize the layout and use FORM. > > So a simple e

[web2py] scheduler causing mariadb deadlocks

2014-08-20 Thread Christophe Varoqui
Hi, I recently switched from a home-made external scheduler to the web2py-2.9.5 embedded scheduler. Tasks are created at ~1000 tasks/minute rate. About 30% of queue_task() calls end up with a mariadb deadlock involving the dead_workers_name subquery. For example: LATES

[web2py] I don't have a gluon forder in my web2py folder

2014-08-20 Thread Joe
I just noticed that I don't have a gluon folder in the web2py folder. Everything seems to work fine, but as I just watched the tutorial video going through each folder, I realized that I don't actually have a gluon folder. How is this possible? -- Resources: - http://web2py.com - http://web2p

[web2py] Re: scheduler timeouts on successful tasks

2014-08-20 Thread Brad Miller
I'm using Postgresql. I do have debug logging enabled, as you can see in the initial post. Here's a bit more detail: 2014-08-18 07:14:05,079 - web2py.scheduler.zebra.local#34260 - DEBUG - recording heartbeat (RUNNING) 2014-08-18 07:14:08,087 - web2py.scheduler.zebra.local#34260 - DEBU

[web2py] Re: using FORM with new line layout

2014-08-20 Thread sid datta
ok figured it out- need to use the BR() function in the form so form = FORM(INPUT(_name='fname'),INPUT(_name='lname'),*BR(),* INPUT(_type='Submit')) gives the desired result On Sunday, 17 August 2014 15:37:22 UTC-7, sid datta wrote: > > > HI - I wanted to customize the layout and use FORM. > > S

[web2py] Unable to connect to MSSQL via web2py - SSL Security Error

2014-08-20 Thread Ryan Hood
Hi, I am having trouble connecting to a SQL Server Instance via web2py. I tried connecting to three different SQL Server instances (all 2014) on three different servers on three different instances of web2py. Here is the full traceback: Traceback (most recent call last): > File "/home/mdipi

[web2py] Requirements per application

2014-08-20 Thread Kuba Kozłowicz
I would like to know if it is possible to install different set of modules for each application separately. I have a Web2py instance, which consists of serveral applications and the number of applications will grow. Some of those apps use library X in version Y. The apps, that will be deployed

[web2py] create a new skeleton application

2014-08-20 Thread Jason Solack
Hello everyone! I would like to create a new skeleton application to replace what is generated from the new application wizard. is there a way to do this? Thank you jason -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code

Re: [web2py] Can I create an RSS Reader like Techi in web2py?

2014-08-20 Thread Gideon George
OMG! You need to see the reaction I made as soon as I saw the mail from you! I am so excited and full of happiness. I really appreciate a great deal and I pray God will continue to grant you all your heart desires and make all your dreams turn to reality. As a newbie web2py user that has never use

[web2py] gluon folder not in my web2py directory

2014-08-20 Thread Joe
I asked this question before but somehow I don't see my question, maybe I didn't actually post it. I don't seem to have the gluon folder in my web2py folder. All the other folders are there except the gluon folder. However, I have a zip file in the web2py folder named "library". I never opened

Re: [web2py] Re: web2py shell vs terminal shell

2014-08-20 Thread Giacomo Dorigo
no I didn't. Anyway, now I just tried without opening the two prompt, just opening the GUI from the .bat file, and I didn't truncate the table, I just did an insert. Then I tried to input some other commands and it keeps repeating the insert. So it seems it's not the truncate. I tried also the db.c

[web2py] Re: Using cache for improving pagination recipe in the manual?

2014-08-20 Thread Giacomo Dorigo
In the end I solved with two simple classes, without using cache, but with two queries, one counting total items and one limited by limitby. Also I have looked in slices and I found some pagination plugins. Anyway here the basic code: class PageThread(object): def __init__(self, query, ite

Re: [web2py] Re: Using cache for improving pagination recipe in the manual?

2014-08-20 Thread Giacomo Dorigo
Well, the 10 rows for 30 p was just an example for understanding :) The idea of the was in order to do only 1 query but definitely you are right, it wasn't worth of! On 18 Aug 2014 12:23, "Niphlod" wrote: > if you're presenting 10 rows at a time and expecting the user to navigate > 30 pages, "you

[web2py] web2.py + mpld3: how to display the generated HTML

2014-08-20 Thread Stavros Anastasiadis
I am trying to use mpld3 (http://mpld3.github.io/index.html) to generate an example plot with web2py. so far in my simple example: controller: def example_plot(): import matplotlib.pyplot as plt, mpld3 fig, ax = plt.subplots() plot = ax.plot([3,1,4,1,5], 'ks-', mec='w', mew=5, ms

[web2py] Lets be in the functions

2014-08-20 Thread carol . fonsekaa
*Dear Professional Colleague,* Greetings! Be part of Global Leadership Awards 2014 on 20th December, 2014 by Federation of Industries. Request you to kindly nominate/send delegates from your Organization or send nominations for awards. Also contact us if you are interested in tie-up/co

[web2py] DAL insert(): ID increases even after rollback()

2014-08-20 Thread Jan Beilicke
Hi all, since a long time I'm working on a web2py project again. And it was about time! ;) While trying to refresh my mind, I was tinkering with DAL and a MySQL database in iPython and I was wondering: The reference [1] states that on a rollback the counter would be rolled back as well. Unfo

[web2py] websocket ssl

2014-08-20 Thread Maciej S
Is it possible to run websocket server (web2py/gluon/contrib/websocket_messaging.py) with ssl support, how to do it? Thank you for reply. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

Re: [web2py] Re: Reload another component with new params

2014-08-20 Thread Manuele Pesenti
Il 20/08/14 16:47, Niphlod ha scritto: > just use $.web2py.component(url, target, timeout, times). Additional > "bonus points" for emptying the target before loading the new content, > just to be safe. wow it works great! Thanks Nophlod... it's a pity it's not documented in the manual. Cheers

[web2py] Slow first time access on production with Ubuntu/NGINX/UWSGI

2014-08-20 Thread Jim S
Hi I've installed web2py on my ubuntu machine using the script at the bottom of this section in the book: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx It is all working well except for one annoyance. If I leave the let the page site for a while (haven't really deter

Re: [web2py] DAL: Rollback of an insert doesn't roll back the counter

2014-08-20 Thread Jan Beilicke
Am Mittwoch, 20. August 2014 17:59:29 UTC+2 schrieb viniciusban: > > Inline answers. > > On Wed, Aug 20, 2014 at 12:49 PM, Jan Beilicke > wrote: > > (second try, somehow my post wasn't published) > > > > ... > > > > According to the reference [1] the counter should be rolled back when > d

[web2py] Re: response.flash not hiding when empty

2014-08-20 Thread lyn2py
OMG troubleshooted for the whole day, even tried replicating in a minimal app with no avail. One good question from Niphlod resolved it… LOL Wasted hours. Thank you very much sir! On Wednesday, August 20, 2014 11:39:40 PM UTC+8, Niphlod wrote: > > where is web2py.css ? > > On Wednesday, August

Re: [web2py] DAL: Rollback of an insert doesn't roll back the counter

2014-08-20 Thread Vinicius Assef
Inline answers. On Wed, Aug 20, 2014 at 12:49 PM, Jan Beilicke wrote: > (second try, somehow my post wasn't published) > > ... > > According to the reference [1] the counter should be rolled back when > db.rollback() is called. The autoincrement column (id) is controlled by the RDBMS. You shoul

[web2py] DAL: Rollback of an insert doesn't roll back the counter

2014-08-20 Thread Jan Beilicke
(second try, somehow my post wasn't published) Hi all, since a long time I have the opportunity to work on a web2py project again - it was about time! To refresh my mind I was tinkering with DAL and a MySQL database in an iPython shell and I was wondering: According to the reference [1] the c

[web2py] Re: a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
That works, thanks. On Wednesday, 20 August 2014 15:30:26 UTC, Niphlod wrote: > > isn't IS_IN_DB enough when you specify a set ?, e.g. > IS_IN_DB(db(db.other_table.field == True), 'other_table.id', '%(name)s') ? > > On Wednesday, August 20, 2014 5:26:29 PM UTC+2, sasogeek wrote: >> >> I don't kno

[web2py] Re: response.flash not hiding when empty

2014-08-20 Thread Niphlod
where is web2py.css ? On Wednesday, August 20, 2014 5:36:58 PM UTC+2, lyn2py wrote: > > This is the code in the HTML HEAD: > > ...css files here... > > > > > > > Appreciate any help. Thanks! > > > On Wednesday, August 20, 2014 10:15:25 PM UTC+8, lyn2py wrote: >> >> I'm not using the we

[web2py] Re: response.flash not hiding when empty

2014-08-20 Thread lyn2py
This is the code in the HTML HEAD: ...css files here... Appreciate any help. Thanks! On Wednesday, August 20, 2014 10:15:25 PM UTC+8, lyn2py wrote: > > I'm not using the welcome app since I will be moving away from using BS3 > in my next app, but I want to keep the functionality o

[web2py] Re: a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
Actually I haven't thought about trying that. never occurred to me... but I'll do that now and give you feedback if it does what I want :) It appears that would work though, thank you On Wednesday, 20 August 2014 15:30:26 UTC, Niphlod wrote: > > isn't IS_IN_DB enough when you specify a set ?, e.g

[web2py] Re: a selective select

2014-08-20 Thread Niphlod
isn't IS_IN_DB enough when you specify a set ?, e.g. IS_IN_DB(db(db.other_table.field == True), 'other_table.id', '%(name)s') ? On Wednesday, August 20, 2014 5:26:29 PM UTC+2, sasogeek wrote: > > I don't know if the title of the question makes any sense but here's what > I want to achieve. In th

[web2py] a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
I don't know if the title of the question makes any sense but here's what I want to achieve. In the model db.py, i can have a field that references another table via Field('fieldname', db.other_table), but this gives me a select html element in the views which has all the items in the other_tab

[web2py] putting in a custom render function with T.M()

2014-08-20 Thread Calvin
Hi I am wondering if it is possible to customise the render function within a ``code`` segment with T.M(). I have tried adding the extra keyword as documented in the Markmin documentation but this is generating out a keyword not recognised error. Thanks in advance! Calvin -- Resources: - htt

[web2py] Re: What am i doing wrong here? (virtualfields)

2014-08-20 Thread Anthony
> > Depends on where you look in the book: > http://www.web2py.com/books/default/chapter/35/06/the-database-abstraction-layer > > - i just copied that line yesterday. Because of the differences between > your line and mine i googled 'virtual fields web2py' >

Re: [web2py] Re: Reload another component with new params

2014-08-20 Thread Niphlod
just use $.web2py.component(url, target, timeout, times). Additional "bonus points" for emptying the target before loading the new content, just to be safe. On Wednesday, August 20, 2014 10:22:02 AM UTC+2, Manuele wrote: > > Il 20/08/14 08:30, Niphlod ha scritto: > > nope, you'd have to do it b

[web2py] response.flash not hiding when empty

2014-08-20 Thread lyn2py
I'm not using the welcome app since I will be moving away from using BS3 in my next app, but I want to keep the functionality of response.flash. So I added web2py.js (I did not include web2py_ajax.html because I won't be needing the other items) The response.flash functionality was in place, ho

Re: [web2py] Re: Reload another component with new params

2014-08-20 Thread Manuele Pesenti
Il 20/08/14 08:30, Niphlod ha scritto: > nope, you'd have to do it by hand using $.web2py.component can you tell me something more? So in some way is it possible to obtain the same result to reload a component with new params? Thank you Niphlod M. -- Resources: - http://web2py.com - http://