[web2py] Re: How do we set multiple "DAL client" connections?

2011-01-13 Thread mart
Definitely, that does help! thanks for making sense of it :) I'll try what you suggest and post results. thanks for your input! Mart :) On Jan 13, 11:54 pm, ron_m wrote: > Hmm looking at the DAL code I am talking above about a web2py use of dal.py. > It looks like the code you normally put i

Re: [web2py] non-string (type list) error in appadmin on GAE

2011-01-13 Thread Jonathan Lundell
On Jan 13, 2011, at 9:45 PM, johntynan wrote: > > I recently updated my web2py app to version 1.91.6 (along with > updating GAE to version 1.4.1) and am now able to export csv files > from the appadmin as I had intended. > > However, now, if I try to view _any_ of the rows within the tables by >

[web2py] non-string (type list) error in appadmin on GAE

2011-01-13 Thread johntynan
I recently updated my web2py app to version 1.91.6 (along with updating GAE to version 1.4.1) and am now able to export csv files from the appadmin as I had intended. However, now, if I try to view _any_ of the rows within the tables by way of the appadmin, I receive a "TypeError: __str__ returned

[web2py] Re: Keys and GAE

2011-01-13 Thread howesc
Matt, given the arbitrary depth of the keys, perhaps it would be better to have the user construct the key, and then have some form of operator to indicate that you desire to run a key query? what are your thoughts on that? would that be better or worse from your perspective? cfh

[web2py] Re: Why the need of return dict() in controller?

2011-01-13 Thread pbreit
Wait, so are you saying that instead of return dict(items=items, blah=blah, etc) we can just use return locals() on most or all controllers? What's the downside, memory? Implicitness?

[web2py] Re: Error using setup-web2py-ubuntu.sh on Linode

2011-01-13 Thread Christopher Steel
On Jan 13, 11:15 am, Chase Lee wrote: > I believe this script sets the config elsewhere.  Looking at the > script, it's here:  > /etc/apache2/sites-available/default (line 152 > athttp://code.google.com/p/web2py/source/browse/scripts/setup-web2py-ub...) > > I checked the httpd.conf file and it w

[web2py] Re: How do we set multiple "DAL client" connections?

2011-01-13 Thread ron_m
Hmm looking at the DAL code I am talking above about a web2py use of dal.py. It looks like the code you normally put in the models directory can just be put in your program inline. Maybe someone else that has used the dal stand-alone can comment better than me. I see a set_folder static method b

[web2py] Re: Interview with Massimo published

2011-01-13 Thread VP
I am very suspicious that this interview is translated by something like GoogleTranslate from (maybe) Italian. It reads very rough. May not be a good thing. On Jan 13, 7:36 pm, Bruno Rocha wrote: > http://blog.gilsondev.com/2011/01/13/interview-creator-of-web2py/

Re: [web2py] ajax append target

2011-01-13 Thread Philippe ENTZMANN
Yes it is possible but more related to jQuery. Use the jQuery append() function to add your ajax result in any DOM part of your page. cf http://api.jquery.com/append/ 2011/1/13 Francisco Costa : > Hello! > I have an ajax function that return some values. > The thing is that I don't want it to rep

[web2py] Re: what will happen if mysql server close all connection every 5 minutes?

2011-01-13 Thread Massimo Di Pierro
No. It is this line db = DAL("mysql://root:passw...@127.0.0.1/mydb") that connects and in a multi-threaded enviroment recycles connection using a connection pool. I a connection from the pool is dead, it tries reconnect. This happens in normal web2py apps. In your code you are just running a sc

[web2py] Re: How do we set multiple "DAL client" connections?

2011-01-13 Thread ron_m
As I understand the workings, the files under the model directory define the tables and relations and the connection string to the database server. Without that DAL is a bunch of code with nothing to play against to tell it what to do with the database for the data access. The databases directo

[web2py] Re: Interview with Massimo published

2011-01-13 Thread Anthony
Thanks for sharing this. Very cool to hear some of the history and motivation behind web2py. On Thursday, January 13, 2011 8:36:29 PM UTC-5, rochacbruno wrote: > > http://blog.gilsondev.com/2011/01/13/interview-creator-of-web2py/ > >

[web2py] Re: How do we set multiple "DAL client" connections?

2011-01-13 Thread mart
thanks ron_m :), yes that about the size of it :) I tried that, but I didn't know that part about the migrate where the models are changing (or the same)... Maybe that may explain my poor success here... So, you're saying the the "client" has to have a copy of the model? I don't get that... Is ther

Re: [web2py] country / state / city of the current visitor?

2011-01-13 Thread Bruno Rocha
I fund this useful script: http://eternal-todo.com/var/scripts/geoloc Bruno Rocha http://about.me/rochacbruno/bio

[web2py] Re: what will happen if mysql server close all connection every 5 minutes?

2011-01-13 Thread hywang
I found it won't auto reconnect at this situation: from dal import DAL from dal import Field import time db = DAL("mysql://root:password@127.0.0.1/mydb") db.define_table("table1", Field("name"), migrate = False ) db.table1.insert(name="jim") db.commit() # Close the connection from mys

[web2py] Interview with Massimo published

2011-01-13 Thread Bruno Rocha
http://blog.gilsondev.com/2011/01/13/interview-creator-of-web2py/

[web2py] Re: How do we set multiple "DAL client" connections?

2011-01-13 Thread ron_m
I think I understand you want to run Python programs with the DAL embedded standalone as well as multiple instances of web2py. You should be able to do that, the database will treat each client as a different connection. The migrate option on the table definitions should be true only on one co

[web2py] Re: ajax append target

2011-01-13 Thread Francisco Costa
forget it.. it works! the thing is that i have a

[web2py] Re: ajax append target

2011-01-13 Thread Francisco Costa
that replaces the target contet with a string "var x=$('#target'); x.html(x.html()+' " what is wrong? On Jan 13, 11:18 pm, Massimo Di Pierro wrote: > ajax(url,[...],':eval') > > and in action > > return "var x=$('#target'); x.html(x.html()+'%s');" % > content.replace("'","\\'") > > On Jan 13,

[web2py] How do we set multiple "DAL client" connections?

2011-01-13 Thread mart
Is there a way for establish "DAL client-like" connections? users would need to look through any number of DBs... There is One central web2py instance, many computers running script that use DAL outside of a web context, and several other web2py instance... the most important is at the script

[web2py] Re: ajax append target

2011-01-13 Thread Massimo Di Pierro
ajax(url,[...],':eval') and in action return "var x=$('#target'); x.html(x.html()+'%s');" % content.replace("'","\\'") On Jan 13, 4:31 pm, Francisco Costa wrote: > Hello! > I have an ajax function that return some values. > The thing is that I don't want it to replace the content of my target >

[web2py] Re: plugin_powertables: is this expected behavior?

2011-01-13 Thread mart
Thanks bruno, that makes perfect sense (and doesn't seem to break anything by having them) - your powertables do look great BTW! I'm having simular issues, for now my solution was to pass the object around by simply having every other class inherit from a "DAL dedicated" class. But now, I need to

[web2py] ajax append target

2011-01-13 Thread Francisco Costa
Hello! I have an ajax function that return some values. The thing is that I don't want it to replace the content of my target div. Instead i would like to append it to the values that are already there. Is this possible?

[web2py] JSON questions and a workaround

2011-01-13 Thread Lorin Rivers
OK, if I specify which columns get returned in my rows, generic.json returns "no json". If my function returns rows.as_list(), generic.json works, but my generic.csv breaks. I figured out this, though, which seems to work, but I don't know if it's wise. Also, it doesn't seem like it should be

[web2py] Re: vote for Pycharm support for Web2py

2011-01-13 Thread Oleg
up :)

Re: [web2py] Should I work for free? Funny

2011-01-13 Thread Richard Vézina
Really funny! Nice relaxing break. ;-) Richard On Thu, Jan 13, 2011 at 3:55 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > http://jhische.com/workforfree.html

Re: [web2py] About bugreports

2011-01-13 Thread howesc
RE bug reports: there is also google code to post bug reports to: http://code.google.com/p/web2py/issues/list i know that at times things get backed up, and occasionally a bug gets missed, which is why we have been encouraged to start using the google code bug tracking. RE modifying field typ

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Jonathan Lundell
On Jan 13, 2011, at 11:49 AM, Lorin Rivers wrote: > > That's exactly the kind of user experience I want to avoid. You could put a copy in web2py's site-packages, though it'd have to be the right version for the environment (or at least a compatible version). You could put it in your app's modul

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Anthony
And for details, check out: http://web2py.com/book/default/chapter/04#Third-Party-Modules On Thursday, January 13, 2011 2:52:50 PM UTC-5, rochacbruno wrote: > Put your libraries under app/modules an use local_import() > > Bruno Rocha > http://about.me/rochacbruno/bio > > > 2011/1/13 Lorin Riv

[web2py] Re: Exception in "belongs" query on GAE and list:reference

2011-01-13 Thread Massimo Di Pierro
I believe this is fixed in trunk. Can you please try? On Jan 13, 1:01 pm, Roman Imankulov wrote: > Hello, > > I'm pretty new in web2py, and I've got a problem while trying to get > the results of 'belongs' query. > > My aim is to use list:reference to make a many-to-one relationship. > Below is a

Re: [web2py] Re: generic.csv works perfectly, generic.json reports no json?

2011-01-13 Thread Lorin Rivers
What do I put in generic.json to expose the details of the exception? On Jan 13, 2011, at 13:46 , Wikus van de Merwe wrote: > Do you have the "generic.json" view? Change it to print out the details of > the exception thrown there. My guess is that you need escaping=True. -- Lorin Rivers Mosasa

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Bruno Rocha
Put your libraries under app/modules an use local_import() Bruno Rocha http://about.me/rochacbruno/bio 2011/1/13 Lorin Rivers > That's exactly the kind of user experience I want to avoid. > > > On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: > > > try to import, and if fails, generate mes

Re: [web2py] if user going logged out

2011-01-13 Thread Bruno Rocha
I figure out a problem with logout, so you have to do something like this. def define_user_session(): if auth.user: session['my_user_id'] = auth.user.id auth.settings.login_onaccept.append(lambda x:define_user_session()) and you got: session['my_user_id'] Bruno Rocha htt

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Lorin Rivers
That's exactly the kind of user experience I want to avoid. On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: > try to import, and if fails, generate message to user to install it on the > system > > > Alexandre Andrade > Hipercenter.com Classificados Gratuitos e Inteligentes > > > > 201

[web2py] Re: generic.csv works perfectly, generic.json reports no json?

2011-01-13 Thread Wikus van de Merwe
Do you have the "generic.json" view? Change it to print out the details of the exception thrown there. My guess is that you need escaping=True.

Re: [web2py] if user going logged out

2011-01-13 Thread Bruno Rocha
Include it in your model, after the auth=Auth(...) def define_session(user_id): session['myuser_id'] = user_id auth.settings.login_onaccept.append(lambda form:define_session(auth.user.id )) and, even the user is logget out, you will have the session['myuser_id'] def user(): if reque

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Alexandre Andrade
try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers > I am using tabular (which requires > numpy), as well as psycopg2 and a numb

[web2py] Best practice for including python libraries with my app

2011-01-13 Thread Lorin Rivers
I am using tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the

[web2py] generic.csv works perfectly, generic.json reports no json?

2011-01-13 Thread Lorin Rivers
In my app, I can build somewhat complex urls (ex: that give me precisely the csv output I require. The function exportRecords returns a dict (records=records) and records is a rows object. If I change the url from using exportRecords.csv to using exportRecords.json it reports "no json". What

[web2py] Re: if user going logged out

2011-01-13 Thread Massimo Di Pierro
There are two web2py methods: Set.update(...) Row.update_record(...) While this Row.update(...) is not a web2py method is a dict method and it does not update the db. Anyway, this not relevant to pk question. On Jan 13, 1:14 pm, Richard Vézina wrote: > On Thu, Jan 13, 2011 at 2:00 PM, pk wr

[web2py] Re: if user going logged out

2011-01-13 Thread Massimo Di Pierro
yes def user(): if request.args(0) == 'logout': db(db.nao.userid==auth.user.id).update(ipadress="") return dict(form=auth()) On Jan 13, 1:00 pm, pk wrote: > hi > > one question: > def user(): >     if request.args(0) == 'logout': >         query >     return dict(form=auth()) > w

Re: [web2py] if user going logged out

2011-01-13 Thread Richard Vézina
On Thu, Jan 13, 2011 at 2:00 PM, pk wrote: > hi > > one question: > def user(): >if request.args(0) == 'logout': >query >return dict(form=auth()) > what is if i need there the auth.user.id??? > > this is my query: > db(db.nao.userid==auth.user.id).update_record(db.nao.ipadress="")

[web2py] Exception in "belongs" query on GAE and list:reference

2011-01-13 Thread Roman Imankulov
Hello, I'm pretty new in web2py, and I've got a problem while trying to get the results of 'belongs' query. My aim is to use list:reference to make a many-to-one relationship. Below is a sample controller I tried to run with both web2py-current and web2py-nightly and with GAE as storage backend.

[web2py] if user going logged out

2011-01-13 Thread pk
hi one question: def user(): if request.args(0) == 'logout': query return dict(form=auth()) what is if i need there the auth.user.id??? this is my query: db(db.nao.userid==auth.user.id).update(db.nao.ipadress="") is this possible? if not how can i do this? peter

Re: [web2py] new router

2011-01-13 Thread Jonathan Lundell
On Jan 12, 2011, at 4:56 PM, Bruno Rocha wrote: > I am trying to configure a different way of routing, may be you can help me > or point some hint about it, > It is a system where the user will register himself and get instant access to > an account (just like twitter), and the system will give a

[web2py] Re: Error using setup-web2py-ubuntu.sh on Linode

2011-01-13 Thread Chase Lee
I believe this script sets the config elsewhere. Looking at the script, it's here: > /etc/apache2/sites-available/default (line 152 at http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-ubuntu.sh?r=3a6e5603379e5472320154247ac00b3b2a604f4a) I checked the httpd.conf file and it wa

[web2py] Re: Need Help Using CRUD with Self-Referencing Tables

2011-01-13 Thread SaltyCow
Okay, I figured out what was wrong: 1. To make crud create produce a drop-down select for the reference field, I needed to add a "requires is_in_db" statement referencing the same table. That was a dumb oversight on my part. 2. The crud read needed to be replaced by a custom query using with_alia

[web2py] Re: Why the need of return dict() in controller?

2011-01-13 Thread Massimo Di Pierro
Some people do not want to return everything in locals() but there is nothing wrong in returning locals(). Actually I like it a lot. Renaming vars just causes confusion. On Jan 13, 3:27 am, Bob wrote: > Is there anything I am missing? Why would you want to manually create > a dictionary of all

[web2py] Why the need of return dict() in controller?

2011-01-13 Thread Bob
Is there anything I am missing? Why would you want to manually create a dictionary of all the vars you need in Web2py views when you simpli can write return locals() and all the variables will be available in the view

[web2py] Re: Trunk hangs at startup

2011-01-13 Thread Massimo Di Pierro
I removed the debug code from welcome. It does not belong there. It was an example of a new experimental feature. Massimo On Jan 13, 3:21 am, ron_m wrote: > Additional info - to stop the python web2py process I had to use a kill -9 > pid. Once the welcome default controller code was changed then

[web2py] Re: "undefined record" error in appadmin on GAE

2011-01-13 Thread johntynan
Massimo, I just upgraded to 1.91.6 and yes, the checks that had been put in place did resolve this issue for me. Wikus, thank you for the detailed advice. I have more work to do with this, so your suggestion may come in handy. Thanks everyone!

[web2py] Re: EAV Patterns

2011-01-13 Thread Arun K.Rajeevan
May be you like SQLAlchemy and Elixir (it's not web2py specific, but web2py will work with it instead of DAL)

Re: [web2py] [OT](urvey) web2py web browser

2011-01-13 Thread Marin Pranjic
No permission for graphic. On Thu, Jan 13, 2011 at 1:54 PM, Luis Díaz wrote: > Results for 13/01/2011 > > Chrome > 1648% Firefox > 1339%Explorer > 1 3%Safari > 13%Otros > 13%opera > 13%- > total 33100% > > > graphic: > > https://spreadsheets.google.com/g

[web2py] Re: SCRIPT tag

2011-01-13 Thread Francisco Costa
SCRIPT() works just like Massimo told... I just realized that I was coppying the resulting div that contained the javascript through an document.getElementById(id).innerHTML; to another div, and the tags arrent supported! Thank you for your help, and sorry for the confusion I've made. On Jan 12,

Re: [web2py] what will happen if mysql server close all connection every 5 minutes?

2011-01-13 Thread Vasile Ermicioi
if the connection is lost web2py tries to reconnect (5 times )

[web2py] Re: experts

2011-01-13 Thread debebe asefa
Massimo : what is needed is a sort of union with a leader, the leader takes the project and determine the people to work on the project with the cost.DA On Jan 12, 5:57 pm, Massimo Di Pierro wrote: > I agree. We created a google group for members. You should have > received an invite. This discus

Re: [web2py] [OT](urvey) web2py web browser

2011-01-13 Thread Luis Díaz
Results for 13/01/2011 Chrome 1648%Firefox 1339%Explorer 13%Safari 13%Otros 13%opera 13%- total 33100% graphic: https://spreadsheets.google.com/gform?key=0AmLSamhVd-XldEZVOU16eE80VWdPQ0lMVWlTWl82Y2c&hl=es&pli=1&gridId=0#chart -- Díaz Luis TSU Analisi

[web2py] Re: OT working with semaphores

2011-01-13 Thread cjrh
On Jan 13, 8:49 am, ron_m wrote: > Talk and free book by Prof Allen Downey on semaphores. Cool, thx.

[web2py] Re: query for an empty field

2011-01-13 Thread dederocks
Indeed! Thanks for filling my brain holes. On 13 jan, 12:21, Kenneth Lundström wrote: > == None > == '' > > If I understood your question. > > Kenneth > > > How do you search for records where a field is empty? I can't find the > > operator for this. > >

Re: [web2py] query for an empty field

2011-01-13 Thread Kenneth Lundström
== None == '' If I understood your question. Kenneth How do you search for records where a field is empty? I can't find the operator for this.

[web2py] query for an empty field

2011-01-13 Thread dederocks
How do you search for records where a field is empty? I can't find the operator for this.

[web2py] what will happen if mysql server close all connection every 5 minutes?

2011-01-13 Thread hywang
Connections may be lost during query, and DAL will not reconnect to server , isn't it ? thank you !

Re: [web2py] About bugreports

2011-01-13 Thread Kenneth Lundström
But if you let the wizard create your tables you have the ID field in your models file. Like I have db.define_table('t_payment_receiver', Field('id','id', represent=lambda id:SPAN(id,' ',A('view',_href=URL('payment_receiver_read',args=id, Field('f_name', type='string', label=T('Nam

Re: [web2py] About bugreports

2011-01-13 Thread Vasile Ermicioi
db.define_table('table1', Field('field1')) table1 will have 2 fields: field1 and id if it is so then nothing strange, it is the way web2py's dal works it always adds the field 'id' as primary key

[web2py] Re: Trunk hangs at startup

2011-01-13 Thread ron_m
Additional info - to stop the python web2py process I had to use a kill -9 pid. Once the welcome default controller code was changed then the next time the server stopped properly using the Tcl control Server->Quit menu item.

[web2py] Re: Trunk hangs at startup

2011-01-13 Thread ron_m
It is only the welcome application that stalls loading the default index page, opening a different application works fine. applications/welcome/controller/default function index() has this new debug code between def and return m = 'You are successfully running web2py.' import gluon.debu

[web2py] About bugreports

2011-01-13 Thread Kenneth Lundström
Hello everybody, for the past month I have sent maybe 3-4 bugreports to this list, but so far only 1 of them have been answered. It feels a litte bit stupid to send those reports without getting any responce. Am I sending them to the wrong place or are they so simple that I should be able to s

[web2py] Re: Storing the Original Filename in the official web2py book

2011-01-13 Thread cjrh
On Jan 12, 5:57 pm, carlo wrote: > if request.vars.image!=None ## always True > > should be > > if request.vars.image I changed the book recently, on the basis of this issue on the web2py Google Code site: http://code.google.com/p/web2py/issues/detail?id=110&can=1&q=image If you have further in