Re: [web2py] Re: How to intercept download request

2014-05-23 Thread Mandar Vaze / मंदार वझे
Derek, On Fri, May 23, 2014 at 1:29 AM, Derek sp1d...@gmail.com wrote: no, i don't see how you could. web2py leaves it up to the webserver to send the file. you'd need to modify the webserver, but since the webserver is handed off the path of the file then you have no way of raising an

Re: [web2py] how string_agg for groupby?

2014-05-23 Thread Joe Barnhart
It's super-easy Richard. You can provide a list of Field objects or a list of colnames in table.field format and it will return a Rows object for you. It's almost too easy! rows=db.executesql(select id,code,name from lsc, colnames=['lsc.id','lsc.code','lsc.name']) -- Joe

Re: [web2py] Re: How to intercept download request

2014-05-23 Thread Niphlod
because there's not native event on a completed download nor a callback to use in ANY browser. Simply put, there aren't tools in the HTML word to report back a finished download. On Friday, May 23, 2014 8:33:32 AM UTC+2, Mandar Vaze wrote: Derek, On Fri, May 23, 2014 at 1:29 AM, Derek

Re: [web2py] URL() and HTTPS

2014-05-23 Thread Niphlod
Again.. it's not over and over.. it happens the only first request that comes in pointing to anything http(ish). Second, third, etc will point to https already. On Thursday, May 22, 2014 3:08:01 PM UTC+2, Richard wrote: Yeah you are right, I forget about relative URL, since I was

[web2py] Re: Confusion: Web2py scheduler spawning a new child process for every task?

2014-05-23 Thread Niphlod
On Wednesday, May 21, 2014 11:09:02 PM UTC+2, Apoorve Mohan wrote: Hello All I am running my web2py app over apache. At backend I start a a web2py scheduler using *python web2py.py -K my-app*. When I do a *ps -ef* on my console, before adding any task to the queue, I see a single process

[web2py] Re: How to improve performance for db queries

2014-05-23 Thread Sarbjit
HI Anthony, Changes suggested by you in the controller to reduce the complexity of the function actually worked, now the drop down options are changed instantly. However, I am observing one strange problem now. Somehow the getResults() function is not called when the drop down options are

[web2py] Record representation : multiple levels of references

2014-05-23 Thread Louis Amon
Say I have a table like this: db.define_table('person', Field('first_name'), Field('last_name'), format='%(first_name)s %(last_name)s' Now if I build a new table: db.define_table('key', Field('person_id', 'reference person', requires=IS_IN_DB(db, db.person, label=db.person._format))) My new

[web2py] How to use modal with an if condition

2014-05-23 Thread LoveWeb2py
Is this possible? I basically want to try and write a function that says if the result == 3: popup a modal box I followed this example: http://getbootstrap.com/2.3.2/javascript.html#modals But I just can't figure out how to make the modal pop up in the same window. I am thinking it will

[web2py] Re: multiple forms created by for in:

2014-05-23 Thread Lucas Schreiber
Alright, now i understand. Thats a pretty good structur, thank you very much :) Am Donnerstag, 22. Mai 2014 13:12:19 UTC+2 schrieb Lucas Schreiber: Hey, i'm sorry, i need help again :) i have a db table, and i want to create a üage where for every row is a form. my idea looks like this:

Re: [web2py] Re: Web2py Hosting

2014-05-23 Thread António Ramos
my ping rtt to webfaction account is 60ms my ping rtt to digitalOcean account is 85ms 2014-05-22 18:27 GMT+01:00 Adnan Smajlovic adnan.smajlo...@gmail.com: I switched to Digital Ocean based Anthony's previous suggestion, and have only words of praise (price/speed/support)!!! Got nginx+ubuntu

Re: [web2py] Re: Web2py Hosting

2014-05-23 Thread Philip Kilner
Hi, On 23/05/14 11:07, António Ramos wrote: my ping rtt to webfaction account is 60ms my ping rtt to digitalOcean account is 85ms Not sure of the significance of that if we don't know where you're pinging /from/? We use Linode for the big stuff and DO for the small stuff, FWIW. I have

Re: [web2py] Re: Web2py Hosting

2014-05-23 Thread António Ramos
where do i find a promo code for linode? 2014-05-23 11:19 GMT+01:00 Philip Kilner phil.kil...@gmail.com: Hi, On 23/05/14 11:07, António Ramos wrote: my ping rtt to webfaction account is 60ms my ping rtt to digitalOcean account is 85ms Not sure of the significance of that if we

[web2py] multiple models in a plugin component

2014-05-23 Thread Louis Amon
I am trying to build a big 'plugin component', with a plugin manager and therefore using the full naming conventions specified in the doc. My model is starting to be huge (1000+ lines) and I'm trying to split it into multiple files. Is there a way to name these files so that web2py still

Re: [web2py] Re: Web2py Hosting

2014-05-23 Thread Anthony
And when you hit the $20+ level, Linode is now price competitive with Digital Ocean (but DO also offers $5 and $10 plans, whereas the cheapest Linode is $20). Anthony On Friday, May 23, 2014 6:19:27 AM UTC-4, Philip Kilner wrote: Hi, On 23/05/14 11:07, António Ramos wrote: my ping rtt

[web2py] Re: Record representation : multiple levels of references

2014-05-23 Thread Anthony
You can use a lambda: db.define_table('other_table', Field('key_id', 'reference key', requires=IS_IN_DB(db, 'key.id', lambda r: '%s %s (%s)' % (r. person_id.first_name, r. person_id.last_name, r.id Anthony On

[web2py] Re: How to improve performance for db queries

2014-05-23 Thread Anthony
Not sure I follow. Please show the code. Also, I'm surprised that code change made such a difference. My code did limit the select to just the necessary fields. Does that table include other fields that contain large amounts of data (e.g., a blob field)? Anthony On Friday, May 23, 2014

[web2py] run web2py in a read only filesystem

2014-05-23 Thread Carlos Cesar Caballero Díaz
Hi, is possible to run web2py (windows and linux versions) in a read-only filesystem (like a cd or dvd) using sqlite, assuming that the application does not require write changes to the database?. -- Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed

Re: [web2py] URL() and HTTPS

2014-05-23 Thread Richard Vézina
You don't follow my reflexion... I just say that if there were no relative URL and the behaviour you describe... 60 ms over and over could have been a great improvement... Thanks again for you answer Niphold. Richard On Fri, May 23, 2014 at 4:27 AM, Niphlod niph...@gmail.com wrote:

[web2py] web2py and whoosh

2014-05-23 Thread Carlos Cesar Caballero Díaz
Hi, I'm using web2py and whoosh in an application that stores documents and makes google-like searches, using https://github.com/mdipierro/web2py-haystack as starting point, but I'm having problems with the character encoding when Latin letters (á é í etc ...) appears. Someone has faced this

Re: [web2py] How to use modal with an if condition

2014-05-23 Thread Richard Vézina
We will need more background and code... What result is? a field that a user is actually filling or the content of a variable that you can determine at the controller level? If the later it is easy : {{if result == 3:}} modal html modal javacript in the javascript trigger the modal {{pass}}

[web2py] Re: Record representation : multiple levels of references

2014-05-23 Thread Louis Amon
wicked cool thanks a bunch ! On Friday, May 23, 2014 3:28:43 PM UTC+2, Anthony wrote: You can use a lambda: db.define_table('other_table', Field('key_id', 'reference key', requires=IS_IN_DB(db, 'key.id', lambda r: '%s %s (%s)' % (r. person_id.first_name,

[web2py] Re: web2py and whoosh

2014-05-23 Thread Derek
I've seen this before when the layout.html didn't include the character coding portion. On Friday, May 23, 2014 7:49:39 AM UTC-7, Carlos Cesar Caballero Díaz wrote: Hi, I'm using web2py and whoosh in an application that stores documents and makes google-like searches, using

[web2py] Re: There were changes in MS SQLServer driver?

2014-05-23 Thread Derek
if you read the whole thing, he changed the way it works. db = DAL('mssql://dsn=192.168.0.52;user=usr1;password=pwd1;') hint: You have to use DBAPI 2.0 connection strings. http://legacy.python.org/dev/peps/pep-0249/#footnotes On Tuesday, May 20, 2014 10:17:09 PM UTC-7, Nguyen Minh Tuan wrote:

[web2py] How to make session variables persist even after logout ?

2014-05-23 Thread Mandar Vaze
I have two applications using different versions of web2py I'm using session variables to store some sort of user preferences. First one uses version 2.3.2 Here - I set the session variables after user selects their preferences. These values are available even after user logs out and logs back

[web2py] Re: Translate html file to python file

2014-05-23 Thread Derek
the word you are looking for is 'render'. response.render(dict) Look at example 40 here. http://www.web2py.com/init/default/examples On Wednesday, May 21, 2014 6:30:33 AM UTC-7, ilyas toxanbayev wrote: How to convert html file to python file. Example: test.html : *pSomething/p * *{{for

[web2py] Re: How to make session variables persist even after logout ?

2014-05-23 Thread Derek
A session should only be temporary storage related to the current session. If you are storing preferences in user accounts then you should store them with the user accounts, not using a session. I don't see what your problem is. On Friday, May 23, 2014 10:58:40 AM UTC-7, Mandar Vaze wrote: I

Re: [web2py] how string_agg for groupby?

2014-05-23 Thread Richard Vézina
Nice! Thanks Joe :) Richard On Fri, May 23, 2014 at 3:28 AM, Joe Barnhart joe.barnh...@gmail.comwrote: It's super-easy Richard. You can provide a list of Field objects or a list of colnames in table.field format and it will return a Rows object for you. It's almost too easy!

[web2py] Are MD5sums posted for Web2Py?

2014-05-23 Thread Dave S
I just downloaded the Normal (stable?) version and the Developer's (nightly?) version for use on a Centos machine, and I wanted to check that I got what I think I got. The values I get are # developer version d083f552b19ac25d24020fdc6388baea # normal fe8e532990006964fda40478ef18d663 /dps --

[web2py] Re: Are MD5sums posted for Web2Py?

2014-05-23 Thread Dave S
On Friday, May 23, 2014 11:57:27 AM UTC-7, Dave S wrote: I just downloaded the Normal (stable?) version and the Developer's (nightly?) version for use on a Centos machine, Also, I can't see what I did wrong at startup, but the admin interface is disabled because of insecure channel. I'm

[web2py] Re: How to make session variables persist even after logout ?

2014-05-23 Thread Anthony
Yes, due to a security vulnerability, the behavior was changed -- now by default, a new session ID is created upon either login or logout, and upon logout, the session itself is cleared. The behavior can be controlled with these settings (default values shown):

[web2py] Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Louis Amon
Due to external constraints, I need to define two tables that are actually siblings and a third table's field that can choose from any of said tables. e.g.: db.define_table('melon') db.define_table('watermelon') I need the third table's field to be a reference to either of the two first

[web2py] Re: Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Anthony
How would you know whether the field stores an id of the melon table or the watermelon table? On Friday, May 23, 2014 4:52:58 PM UTC-4, Louis Amon wrote: Due to external constraints, I need to define two tables that are actually siblings and a third table's field that can choose from any of

Re: [web2py] Re: Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Louis Amon
Well in this particular case I needn't know wether I'm storing a melon or a watermelon's id. I know it's kind of idiotic but I just need a 'fruit' id. Think of it as a subclassing matter : the API I'm connecting to is doing something along the lines of subclassing anyway, and I need to store

[web2py] Re: Translate html file to python file

2014-05-23 Thread Anthony
Are you saying you want to take a web2py template and generate the intermediate representation in Python code? If so, you can do: from gluon.template import parse_template python_code = parse_template(open('path/to/template', 'rb'), path= 'path/to/views') The path argument should be the path to

Re: [web2py] Re: Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Anthony
I suppose you could just make it type='integer'. Then you could use the IS_IN_SET validator and construct a list of id's from the two tables (keeping in mind you should de-dup the list, as both tables will have many of the same id's). Of course, if you end up storing a value of say, 5, you

Re: [web2py] URL() and HTTPS

2014-05-23 Thread Anthony
Yes, but to be clear, over and over really means once per user session, if and only if the user starts at an http URL, not once per request. Regarding your original point, note that URL() generates neither http nor https URLs by default -- it generates relative URLs that start with /. So, if

[web2py] Re: How to import python functions

2014-05-23 Thread Maurice Waka
Thanks for the update. I wanted to know whether I cant import the function from the python module that contains the print 'message delivered' to the HTML view and have it printed e.g. {{extend 'layout.html'}} {{=test()}} OR do I have to change the python code. Kind regards On Thursday, May

[web2py] Re: D3.js calling Json in View

2014-05-23 Thread thehuman trashcan
Thank you so much Andrew - you have given me plenty to work on... When I'm back I'll give these a go and let you know how I get on. Many thanks again On Friday, 23 May 2014 05:41:16 UTC+1, Andrew W wrote: Also, try scheme='https' in your case. See Core chapter of book. -- Resources: -

[web2py] Simple loan system for library

2014-05-23 Thread john smith
I'm trying to create library system and have a little problem. Here's my current model: db.define_table('tags', Field('name'),format='%(name)s') db.define_table('copies', Field('is_active','boolean',default=True)) db.define_table('book', Field('title',requires=IS_NOT_EMPTY(),

[web2py] Post Request Timeout

2014-05-23 Thread Cory
Hi, I have a url that is supposed to receive a post request that contains xml. This post request is a callback from an api. For some reason the post request cannot connect to the url I have specified. The view that is supposed to receive the request only contains fieldKeys = [] if

[web2py] Re: Web2py on EC2: site does not appear

2014-05-23 Thread Gaurav Kalyan
I am having the similar problem that is when I try to access my public dns apache ubuntu page appear nothing happens On Wednesday, 18 July 2012 07:01:24 UTC+5:30, lyn2py wrote: Ok it works now! Thanks rdodev! On Wednesday, July 18, 2012 4:55:38 AM UTC+8, lyn2py wrote: Connection Timeout

[web2py] Re: D3.js calling Json in View

2014-05-23 Thread thehuman trashcan
In my impatience I just quickly edited the file. data.dashboard_data is all that was needed. I have managed to leave Scheme=true. I don't fully understand how data.dashboard_data converts my dictionary to an array, but I will be looking into this to understand. In any case, thank you ever so

[web2py] Re: Simple loan system for library

2014-05-23 Thread Andrew W
Hi John, One step at a time, looking at your database model, how does 'copies' relate to a book ? You are missing a foreign key reference. Are there any other attributes that a copy may have ? On Saturday, May 24, 2014 7:30:35 AM UTC+10, john smith wrote: I'm trying to create library

[web2py] Re: D3.js calling Json in View

2014-05-23 Thread Andrew W
good work. data just refers to the dictionary. When you open up your json file you just see a dictionary with one key that points to an array. By saying data.dashboard_data you are then directly referencing the value of the key, ie. the array in the dictionary. There are several ways to do

[web2py] Re: How to migrate to UUID references in db without messing up reference fields

2014-05-23 Thread Ian W. Scott
After 10 days I've received no help on this. Is there something about the question that is inappropriate? On Wednesday, May 14, 2014 11:44:43 AM UTC-4, Ian W. Scott wrote: I need to take an existing db and implement a UUID referencing system so that I can sync local db's with a central

[web2py] Re: How to make session variables persist even after logout ?

2014-05-23 Thread Mandar Vaze
Derek, May be I misrepresented my scenario - These aren't exactly preferences. In both the applications - user sees SQLFORM.grid with large number of records. User will use filter to reduce the count. Depending on the user - user is likely to use same filters for quite some time - across