[web2py] Re: Grid without consulting database

2015-09-22 Thread Anthony
The problem is that with this method, you don't get a grid at all, you get a SQLTABLE, so there is literally no "useful stuff" coming from SQLFORM.grid. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] Re: Grid without consulting database

2015-09-22 Thread pjryan126
Good point. I guess it depends on how many features are needed. My own experience is that using the DOM parser to modify grid parts like the buttons gets it pretty far along -- obviously, a lot would be missing, but there is so much useful stuff even with a very basic version of the grid (i.e.

Re: [web2py] How to urlify a computed field?

2015-09-22 Thread St. Pirsch
Got it, grazie 1000! Am Dienstag, 22. September 2015 13:30:21 UTC+2 schrieb Manuele: > > Il 22/09/15 12:32, St. Pirsch ha scritto: > > Yes, this works perfectly. I do not fully understand the line, though. > > What is the [0] actually doing? Isn't there just one row? > > Thank you! > Hi, > we

[web2py] How to show the error/ticket page at the url that caused the error?

2015-09-22 Thread Alfonso Serra
Yes if you have a controller like applications/myapp/default/example that has an error that triggers when you visit http://localhost/myapp/default/example How would you return the admin's error page directly without redirecting? Asuming that you are already logged into the admin panel Some i

[web2py] Re: Grid without consulting database

2015-09-22 Thread Anthony
> > 1. Create a Table object with appropriate fields and set migrate=False > (This creates a dummy table) > 2. Convert row values into a list of tuples > 3. Use db._adapter.parse to create a DAL Rows object using the dummy table: > > t_rows = db._adapter.parse(rows, fields=[f for f in db.dummy_t

[web2py] Re: Grid without consulting database

2015-09-22 Thread Anthony
The web2py grid provides functionality specific to working with database tables defined via the DAL, such as pagination, sorting, searching, field representation, virtual fields, and CRUD operations on records. When dealing with data from third party API's or from other formats (e.g., CSV files

[web2py] Re: How to architect data for high traffic

2015-09-22 Thread Anthony
If the whole database is on a single machine, I'm not sure separate tables would help -- ultimately, a single server still has to handle all the queries. Instead, if you need to handle heavier loads, it might help to scale out to multiple servers. In that case, you could keep the workflow data

[web2py] Re: Server-side DOM parsing not working for me..!

2015-09-22 Thread Anthony
The problem is that the grid sets the value of the "id" attribute of each row to an integer (rather than the string representation of the integer), but the .element method ends up comparing the integer to its string representation. For further details, see the issue

Re: [web2py] How to architect data for high traffic

2015-09-22 Thread Richard Vézina
Difficult to say without know what the architecture exactly is... Sharing a database between app is not supposed to cause any issue since web2py allow you to have multiples connections strings, this is true in reading, but when you write in this database you may facing lock if multiples concurrent

[web2py] How to architect data for high traffic

2015-09-22 Thread Alex Glaros
Many government organizations will share my cloud-based app. Some app features, such as mass idea sharing, need a common table to make it work. Other app features such as individual organization workflow do not require a shared table as they are specific to each organization. A single, common,

[web2py] Server-side DOM parsing not working for me..!

2015-09-22 Thread Edward Shave
I have a sqlform.grid where I found each row (tr) contains an id, so in the example row below the id="2" 2... I can't work out why the following returns None print grid.element('#2') I also tried grid.element(_id='2') but with the same result -- Resources: - http://web2py.com - http://web2py

[web2py] Re: Calling all Boulder, CO web2py users

2015-09-22 Thread Leonel Câmara
Maybe it's worth a try to make a post in https://www.reddit.com/r/boulder or even /r/python, even if people usually use other frameworks they may be interested in learning about web2py. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Grails for web2py - anyone interested ?

2015-09-22 Thread Carlos Cesar Caballero Díaz
Hi graham, It looks interesting, I will look at it when you release it. El 21/09/15 a las 15:12, Graham Ranson escribió: I don't know whether any of you are familiar with Grails (www.grails.org); I was using it for a few years but for a variety of reasons have moved to Python. However there are

Re: [web2py] Re: Files in models directory ignored....

2015-09-22 Thread Sundararajan Seshadri
Got it. Thanks. On Tue, Sep 22, 2015 at 6:03 PM, Leonel Câmara wrote: > This doesn't need to be documented because it is very unpythonic to use > dashes in module names. You can't even import them as usual because the > interpreter thinks you're using a minus you need to use __import__. Anyway,

[web2py] Re: Files in models directory ignored....

2015-09-22 Thread Leonel Câmara
This doesn't need to be documented because it is very unpythonic to use dashes in module names. You can't even import them as usual because the interpreter thinks you're using a minus you need to use __import__. Anyway, don't do it. -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Files in models directory ignored....

2015-09-22 Thread Sundar
Not sure if it is recorded in the documentation. But it took some time for me to figure out that the files in Models Directory that include - (hyphen) in their names are ignored by Web2py - and I do not see them in Appadmin either. Not sure if some other characters (like hyphen) also cause this

Re: [web2py] How to urlify a computed field?

2015-09-22 Thread Manuele Pesenti
Il 22/09/15 12:32, St. Pirsch ha scritto: > Yes, this works perfectly. I do not fully understand the line, though. > What is the [0] actually doing? Isn't there just one row? > Thank you! Hi, web2py Validators always return a tuple in which the first element is the value validated and the second

Re: [web2py] How to urlify a computed field?

2015-09-22 Thread St. Pirsch
Yes, this works perfectly. I do not fully understand the line, though. What is the [0] actually doing? Isn't there just one row? Thank you! Am Dienstag, 22. September 2015 12:04:47 UTC+2 schrieb Massimiliano: > > Could this: > > Field('url_name', compute=lambda r: IS_SLUG(check=False)( > r['fir

Re: [web2py] How to urlify a computed field?

2015-09-22 Thread Massimiliano
Could this: Field('url_name', compute=lambda r: IS_SLUG(check=False)( r['first_name']+'-'+r['last_name'])[0]) work for you? On Tue, Sep 22, 2015 at 8:17 AM, St. Pirsch wrote: > Hi, > I'am trying to generate a slug url from a computed field: > Field('url_name', compute=lambda r: r['first_name']

[web2py] Re: SQLFORM.grid links bug

2015-09-22 Thread zenzeromod
Hi Hiphlod, You are right, I copied from my code a conditional button but without removing all unnecessary code. links = [dict(header=A(XML(STRONG('Stato')), _class='button btn'), body=lambda row: (A(XML('  Pubblica  ' ), _class='button btn btn-default', _href=UR

[web2py] Re: Grid without consulting database

2015-09-22 Thread Gary Cowell
The need to represent data from web services inside a web2py app must be a fairly common requirement, I think. I certainly need(ed) to for a project. I used a sqlite mem db for each page (I was calling Amazon AWS through boto, get lists of stuff, etc.). I did three things to represent my data.