[web2py] Re: Calling a function that exists in another controller

2010-10-30 Thread Luther Goh Lu Feng
Thanks! On Oct 31, 8:23 am, ron_m wrote: > Oops to clarify put the function in a file under the modules > directory. While in development mode the local_import has a reload > option so the code gets reloaded on each request. The default is to > load once on first use which requires server restart

[web2py] Passing pointer to session, requestion, etc objects to module

2010-10-30 Thread b00m_chef
How does one go about passing a pointer to the session and request objects from your app to a module in said app. Basically, in a module, I need to be able to manipulate all those objects without having to return and re-assign them. If I simply pass all the session, request, response, etc objects

[web2py] Setting web2py-component-command

2010-10-30 Thread Luther Goh Lu Feng
I wish to run a script after a component is ajax loaded. To achieve that, I attempted to set the web2py-component-command as follows: == comment_component = function(){ t = $('#comment_text__row textarea').val(); {{response.headers['web2py-component-command']="

Re: [web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread rochacbruno
At my company we started to use this http://www.reviewboard.org/ Integrated with hg I suggest to start using this integrated with the main web2py repository. Enviado via iPhone Em 30/10/2010, às 21:33, mart escreveu: > BTW - have you seen Mondrian? - is built on Perforce. > > http://video

[web2py] Re: Using tuple in db() gives Key Error

2010-10-30 Thread DenesL
In order to get a query object you have to use the field objects and not string representations of them, so you can not do "(db.%s.%s.contains('%s'))" %(filname, term, request.vars[term])) that should be db[filname][term].contains(request.vars[term]) and since queries can be ANDed together, you

[web2py] Re: web2py as a cross-platform mobile application platform

2010-10-30 Thread mdipierro
I have used it more than one year ago, something around version 1.59.*. Let us know what does not work and we can help fix it. On 30 oct, 16:21, pallav wrote: > Hi > > My company is working on a platform for mobile application development > along the lines of PhoneGap and Rhosync. The idea is to

[web2py] Re: Using tuple in db() gives Key Error

2010-10-30 Thread mdipierro
Should be querylist = [] for term in request.vars: if term != 'n': querylist.append(db[filename] [term]contains(request.vars[term])) queryterm = reduce(lambda a,b:a&b, querylist) search = db(queryterm).select() queries should not be strings but objects. It works

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread mart
Yes, agreed , that may have been a little too strong of an opinion, in fact, WAS too strong, so I'll take that back since the intention was not to offend, so apologies for that one. I'll say instead: I think P4 is much better suited when comes time to integrate to processes/ automation such QA aut

[web2py] Re: Calling a function that exists in another controller

2010-10-30 Thread ron_m
Oops to clarify put the function in a file under the modules directory. While in development mode the local_import has a reload option so the code gets reloaded on each request. The default is to load once on first use which requires server restart if a change is needed. On Oct 30, 5:15 pm, ron_m

[web2py] web2py as a cross-platform mobile application platform

2010-10-30 Thread pallav
Hi My company is working on a platform for mobile application development along the lines of PhoneGap and Rhosync. The idea is to have a web2py server running on the mobile device (Android, iPhone, etc.) locally, and have a browser component that is used for UI. The UI would be developed in HTML/C

[web2py] Using tuple in db() gives Key Error

2010-10-30 Thread thylacine222
Hi, I'm running this code right now: querylist = [] for term in request.vars: if term != 'n': querylist.append("(db.%s.%s.contains('%s'))" % (filname, term, request.vars[term])) queryterm = (' & '.join(querylist),) search = db(*queryterm).select() The term in

Re: [web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Jonathan Lundell
On Oct 30, 2010, at 4:24 PM, mart wrote: > > Last point, and I know I am persistently annoying with this, but > mercurial, IMHO, sucks, sucks a lot. Personally I would use nothing > less then the best out there, Perforce, specially if considering > automated testing (again IMHO, but at least a fai

[web2py] Re: Calling a function that exists in another controller

2010-10-30 Thread ron_m
You could put the code in a module and use local_import in both controllers. On Oct 30, 11:52 am, Luther Goh Lu Feng wrote: > Which syntax should I use to call in controllerA.py a private function > __foo() defined in controllerB.py? > > I understand that one recommendation is to implement an XML

Re: [web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Manu
Hi , Not playing in the same league as everyone here , but definitely think that providing better unit tests + ui tests will definitely serve many purposes . First will ensure that release goes smoother and also will be a distinctive advantage over concurrence ( not sure if anyone else has some

Re: [web2py] Re: Remove link in MENU for current url

2010-10-30 Thread Michael Wolfe
Completely optional. On Sat, Oct 30, 2010 at 3:02 AM, annet wrote: > Does this mean that the current menu's behaviour will change, or is > this patch optional? > > Currently, I just style active links differently, and that works fine. > I have seen people who work with different browsers on diffe

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread mart
BTW - have you seen Mondrian? - is built on Perforce. http://video.google.com/videoplay?docid=-8502904076440714866# Mart On Oct 30, 7:24 pm, mart wrote: > Hey, > > Would it make sense not to pull the apps that get built against #head > revision (unless the goal is to test the apps themselves)

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread mart
Hey, Would it make sense not to pull the apps that get built against #head revision (unless the goal is to test the apps themselves) and preferably just pull the code line it self @ #head revision? (follow up on this in next paragraph) And also, I don't know where things stand wrt bug tracking, bu

Re: [web2py] Re: web2py testing & release cycle

2010-10-30 Thread Albert Abril
Ok. Count on me too. I can't organize this, because I'm not an expert in tests, but can contribute with testing. Regards! On Sat, Oct 30, 2010 at 9:03 PM, Luther Goh Lu Feng wrote: > +1 Count me in. I am pretty new to python. But I am sure there are at > least one or two simple test cases for me

Re: [web2py] Re: Stand Alone DAL and migrations (again)

2010-10-30 Thread Thadeus Burgess
Its not about can it be used stand alone. Its about how you have to structure your code when you do. The only reason the DAL works well with web2py is because web2py is executed and designed to be functionally coded. I would suggest SQLAlchemy. Its designed with OOP in mind, and offers more featur

[web2py] Re: a bit of history

2010-10-30 Thread mdipierro
That comment is very old (2-3 years ago). New benchmarks are needed. Massimo On 30 oct, 14:20, Peterle wrote: > at the beginning... > > Comment by Massimo > > my tests show that a loop in Ruby is about 15 times slower than the > same loop in Python. That was enough for me to drop Rails. I’d love

[web2py] Re: a bit of history

2010-10-30 Thread Luther Goh Lu Feng
Any code samples for benchmarking? Versions of python and ruby used? On Oct 31, 3:20 am, Peterle wrote: > at the beginning... > > Comment by Massimo > > my tests show that a loop in Ruby is about 15 times slower than the > same loop in Python. That was enough for me to drop Rails. I’d love > you

[web2py] a bit of history

2010-10-30 Thread Peterle
at the beginning... Comment by Massimo my tests show that a loop in Ruby is about 15 times slower than the same loop in Python. That was enough for me to drop Rails. I’d love you to benchmark Gluon (http://mdp.cti.depaul.edu) which should be even faster than Django because it allows you to byte-

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread Stef Mientki
hi Thadeus, On 30-10-2010 19:42, Thadeus Burgess wrote: > Just my 2 cents. > > Using the DAL on anything but web2py is going to be a pain in the ass and a > nightmare waiting to > happen. This is due to its inherent forced procedural coding style. You "can" > wrap DAL calls as > methods, but it

[web2py] Re: Stand Alone DAL and migrations (again)

2010-10-30 Thread mdipierro
well. I disagree. ;-) http://web2py.com/AlterEgo/default/show/215 On 30 oct, 12:42, Thadeus Burgess wrote: > Just my 2 cents. > > Using the DAL on anything but web2py is going to be a pain in the ass and a > nightmare waiting to happen. This is due to its inherent forced procedural > coding styl

[web2py] Re: web2py testing & release cycle

2010-10-30 Thread Luther Goh Lu Feng
+1 Count me in. I am pretty new to python. But I am sure there are at least one or two simple test cases for me to write tests for. On Oct 31, 1:30 am, b00m_chef wrote: > I was just wondering if it would be possible to have the development > team compile a list of features that need tests written

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Luther Goh Lu Feng
It is reasonable to suggest a universal test app that will assist in the quality assurance of web2py. But I wonder if this will always have 100% test coverage, given that bugs may appear even when writing test cases. This is still a good idea compared to not having a test suite. However, I think I

[web2py] Calling a function that exists in another controller

2010-10-30 Thread Luther Goh Lu Feng
Which syntax should I use to call in controllerA.py a private function __foo() defined in controllerB.py? I understand that one recommendation is to implement an XML-RPC service. But I wonder if this is an overkill as __foo() is just 5 lines. Or should I go with execution environment (http:// www.

Re: [web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Thadeus Burgess
Someone writes a script to automate the process. Have a list of apps that we want to be sure are tested and working. The script will download web2py testing, copy the apps to the downloaded version, fire a process fork to start that web2py, use urllib or httplib to navigate to each of the apps page

Re: [web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Thadeus Burgess
Where should the list of apps come from? I think this is the biggest question. -- Thadeus On Sat, Oct 30, 2010 at 12:46 PM, Thadeus Burgess wrote: > Someone writes a script to automate the process. Have a list of apps that > we want to be sure are tested and working. The script will download

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread Thadeus Burgess
Just my 2 cents. Using the DAL on anything but web2py is going to be a pain in the ass and a nightmare waiting to happen. This is due to its inherent forced procedural coding style. You "can" wrap DAL calls as methods, but it just gets really messy. I'm a clean code zealot, so I bet I care more th

[web2py] web2py testing & release cycle

2010-10-30 Thread b00m_chef
I was just wondering if it would be possible to have the development team compile a list of features that need tests written for them. I would enjoy writing a few tests, though, I don't have time to dig through the whole code base and figure out on my own what needs testing. Ideally, if you guys c

[web2py] Re: .htaccess in web2py

2010-10-30 Thread Francisco Costa
> You might consider configuring passwords in httpd.conf instead of .htaccess, > if you have control over the whole server. Thank you for the suggestion.. I will look into it > Are you doing this as an alternative to web2py auth? No, I've finished a project and I've put it online, but before it g

Re: [web2py] Re: .htaccess in web2py

2010-10-30 Thread Jonathan Lundell
On Oct 30, 2010, at 9:07 AM, Francisco Costa wrote: > >> How is your server configured? What are you using? > > Ubuntu 10.10 + Apache 2 > and I'm serving the files at /var/www/web2py You might consider configuring passwords in httpd.conf instead of .htaccess, if you have control over the whole

[web2py] Re: .htaccess in web2py

2010-10-30 Thread Francisco Costa
> How is your server configured? What are you using? Ubuntu 10.10 + Apache 2 and I'm serving the files at /var/www/web2py

Re: [web2py] Re: .htaccess in web2py

2010-10-30 Thread Jonathan Lundell
On Oct 30, 2010, at 8:47 AM, Francisco Costa wrote: > > tried both.. none worked out :( How is your server configured? What are you using? > > On Oct 30, 4:09 pm, VP wrote: >> I'd think either in web2py root or web2py/applications/yourapp. >> >> On Oct 30, 9:28 am, Francisco Costa wrote: >>

[web2py] Re: .htaccess in web2py

2010-10-30 Thread Francisco Costa
tried both.. none worked out :( On Oct 30, 4:09 pm, VP wrote: > I'd think either in web2py root or web2py/applications/yourapp. > > On Oct 30, 9:28 am, Francisco Costa wrote: > > > I really would like to protect a website content with a .htaccess > > password file like this > > onehttp://www.el

Re: [web2py] Re: .htaccess in web2py

2010-10-30 Thread Jonathan Lundell
On Oct 30, 2010, at 8:09 AM, VP wrote: > > I'd think either in web2py root or web2py/applications/yourapp. This is an interesting question. web2py and its built-in server don't look at .htaccess. Where *does* Apache look when pages are being served dynamically, as with wsgi? Presumably you can'

[web2py] web2py book discount [was Book 3rd Edition, Lulu Printed Copy, comments]

2010-10-30 Thread Jonathan Lundell
On Oct 30, 2010, at 1:49 AM, cjrh wrote: > > My new printed copy of the third edition of the book arrived a few > days ago (took almost 2 months to find me!). Lulu has a 20% discount available through Nov 1: http://www.lulu.com/static/102910_TRICK305Rwv.html/?cid=102910_en_email_TRICK305R

[web2py] Re: .htaccess in web2py

2010-10-30 Thread VP
I'd think either in web2py root or web2py/applications/yourapp. On Oct 30, 9:28 am, Francisco Costa wrote: > I really would like to protect a website content with a .htaccess > password file like this > onehttp://www.elated.com/articles/password-protecting-your-pages-with-ht... > > I just don'

[web2py] Re: link to "object" on same web page

2010-10-30 Thread VP
Something like this: http://web2py.com/book/static/ book_images_png/mywiki_show.png">? http://web2py.com/book/static/book_images_png/mywiki_show.png (Chapter 3, the wiki app tutorial) On Oct 30, 7:37 am, Ole Martin Mæland wrote: > Hi, > > I am new to web2py and I am trying to learn via doing.

[web2py] problem with multiple processes multiple threads

2010-10-30 Thread VP
I can't seem to set up multiple processes, multiple threads. Here's the apache2 setting: WSGIDaemonProcess web2py user=username group=username \ display-name=%{GROUP} processes=3 threads=10 I have a controller that is computing intensive, taking at least a minute to

[web2py] .htaccess in web2py

2010-10-30 Thread Francisco Costa
I really would like to protect a website content with a .htaccess password file like this one http://www.elated.com/articles/password-protecting-your-pages-with-htaccess/ I just don't know where to put the file at... Any help?

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread Luther Goh Lu Feng
On Oct 30, 7:05 am, mdipierro wrote: > Normally it goes to the nightly build, perhaps not exactly the latest > but something very close. The bug in question has been there for about > one week. The problem is that nobody tests the nightly build. > > Massimo > I would love to have a way to test

[web2py] Re: web2py 1.88.1 is OUT

2010-10-30 Thread yamandu
Still an issue with list:string. Whem the update form loads it´s normal. When I submit it and back to it the list:string fields display as ['string','string']. Maybe because I loading the update form via LOAD function without ajax. I tested list:string with the wizard and it works perfectly. On O

[web2py] link to "object" on same web page

2010-10-30 Thread Ole Martin Mæland
Hi, I am new to web2py and I am trying to learn via doing. I am looking at the crm soluiton that Massimo has written. I would like to trigger a task list on the same page as I have company_view and person list. currently my main_company object looks like this: def main_company(): compa

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread Stef Mientki
On 30-10-2010 12:06, rochacbruno wrote: > Look this simple example: > > http://bitbucket.org/rochacbruno/dal_on_flask/src/tip/dalFlask.py > > > I have a PyGTK app running very well, I will put the code online soon. hi Bruno, one other question, in the gtk application, do you access the database th

[web2py] Re: bug on IS_NOT_EMPTY(..)?

2010-10-30 Thread mdipierro
I cannot reproduce the problem. Can you post a simple app to reproduce it? On Oct 30, 3:17 am, Marco Prosperi wrote: > hi all, > > With web2py 1.88.* if you define something like > .. > Field('myfield','string',requires=IS_NOT_EMPTY(error_message=T('my > message')), > .. > > you don't get 'my mes

[web2py] Re: Remove link in MENU for current url

2010-10-30 Thread mdipierro
oops. I did not receive it. I will apply it asap. On Oct 29, 10:01 am, Michael Wolfe wrote: > Massimo, > > I tried sending this patch directly to you, but I'm not sure if you > received it.  In any case, I re-exported the patch this morning so it > runs against trunk. > > Let me know if I've miss

[web2py] Re: web2py automatic installation on KingHost(Brazil) control panel.

2010-10-30 Thread mdipierro
+1 On Oct 29, 10:38 pm, Bruno Rocha wrote: > Brazilian KingHost server now has web2py as an option for automatic > installation on your control panel. > > According to information from the administrators of the host, many customers > were starting to ask for the installation of web2py, and some l

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread Stef Mientki
thanks Bruno, seems like a good starting point. cheers, Stef On 30-10-2010 12:06, rochacbruno wrote: > Look this simple example: > > http://bitbucket.org/rochacbruno/dal_on_flask/src/tip/dalFlask.py > > > I have a PyGTK app running very well, I will put the code online soon. > > > > Em 30/10/201

[web2py] Reloading components at regular intervals

2010-10-30 Thread Luther Goh Lu Feng
I would like to reload a web2py component at regular intervals. Based on my understanding of the documentation, I believe that currently there is no way to do it without writing my own javascript. (Glad to be proven wrong though). I think this feature might be useful and hope that it can be consid

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread rochacbruno
Look this simple example: http://bitbucket.org/rochacbruno/dal_on_flask/src/tip/dalFlask.py I have a PyGTK app running very well, I will put the code online soon. Em 30/10/2010, às 06:33, Stef Mientki escreveu: > Interesting ... > as I want to migrate to web2py > and want to have some kind

[web2py] Book 3rd Edition, Lulu Printed Copy, comments

2010-10-30 Thread cjrh
Hi My new printed copy of the third edition of the book arrived a few days ago (took almost 2 months to find me!). Comments: - It's my first Lulu purchase. The quality is as good as or even better than expected. - The new dark default theme for web2py does not reproduce well in the book. The

Re: [web2py] Re: PostgreSQL super slowdowns

2010-10-30 Thread Thadeus Burgess
I guess its a problem with a postgresql setting, or old drivers maybe? -- Thadeus On Sat, Oct 30, 2010 at 12:45 AM, Chris wrote: > I was just trying the home page...some selects are run on every page > but as far as I know that's it. The machine's got plenty of memory and > this is a very ba

[web2py] bug on IS_NOT_EMPTY(..)?

2010-10-30 Thread Marco Prosperi
hi all, With web2py 1.88.* if you define something like .. Field('myfield','string',requires=IS_NOT_EMPTY(error_message=T('my message')), .. you don't get 'my message' after submitting an empty a SQLFORM (yes, I use if form.accepts...) but the default message. With older versions of web2py there

Re: [web2py] Newb question: How to handle multiple controller levels?

2010-10-30 Thread Kenneth Lundström
I have a controller for different levels, org, customer, appointment and so on. When i want to for example edit a customer the address looks like /hostname/customer/edit/5/2 where 5 is the org and 2 is the customer. Appointment would look like /hostname/appointment/5/2/10 where 10 is the id of

Re: [web2py] Stand Alone DAL and migrations (again)

2010-10-30 Thread Stef Mientki
Interesting ... as I want to migrate to web2py and want to have some kind of DAL for my desktop applications, this sounds very good. Can you give me some guide lines, how to use the web2py DAL for desktop applications ? thanks, Stef Mientki On 19-10-2010 05:44, Bruno Rocha wrote: > I know DAL

[web2py] Re: Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
Never mind. Crushingly brilliant chap that I am, immediately after posting that I realized I have the luxury of constructions like: _href=URL('appointment','edit',args=[customer,appointment]))

[web2py] bug on IS_NOT_EMPTY(..)?

2010-10-30 Thread Marco Prosperi
hi all, With web2py 1.88.* if you define something like .. Field('myfield','string',requires=IS_NOT_EMPTY(error_message=T('my message')), .. you don't get 'my message' after submitting an empty a SQLFORM (yes, I use if form.accepts...) but the default message. With older versions of web2py there

[web2py] Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
I have an app that supports multiple organizations. Each organization has many customers. Each customer has many appointments. I think that means organizations, while controllers, employ a customer controller, which employes an appointment controller. In my head the URL for editing an appointment

[web2py] Re: Reference to the mapping table - No drop down in admin interface

2010-10-30 Thread Steve
Cool. But I am new to both python and web2py. I did something like def showABName(r): a_row = db.table_a[r.a_id] b_row = db.table_b[r.b_id] return a_row.name[0:20] + '-' + b_row.name and in the table definition db.define_table('a_b', Field('a_id', db.table_a), Field('b_id', d

[web2py] Re: Remove link in MENU for current url

2010-10-30 Thread annet
Does this mean that the current menu's behaviour will change, or is this patch optional? Currently, I just style active links differently, and that works fine. I have seen people who work with different browsers on different OS use the active menu link to refresh the current page. Basically becaus