[web2py:21888] Re: Importing modules from controller folder

2009-05-15 Thread Voltron
Hi Massimo! Yes, the problem still persists, it is not possible to import a package or module from a subdirectory in the controller folder, even when I placed an "__init__.py file in almost every folder I still use Web2py for one domain, its just that my boss was not too happy with the problems

[web2py:21889] python path in web2py files

2009-05-15 Thread virhilo
I think the python path in web2py files stould be: /usr/bin/env python instead of /usr/bin/python I make a patch for 796 revision of devel version which correcting it. You can found it here: http://spof.pl/~virhilo/python_path.patch Greets --~--~-~--~~~---~--~~ Yo

[web2py:21890] Re: requires_login(next='')

2009-05-15 Thread annet . vermeer
Massimo, > auth.settings.login_url=URL(r=request, c='crudtool', f='index') > > after logout it goes to login_url, same with failed requires_login. The cause of the problem laid elsewhere: Since I customized the registration process I did not define: def user(): return dict(form=auth()) ins

[web2py:21891] Re: Importing modules from controller folder

2009-05-15 Thread mdipierro
Voltron, I do that all the time so something else is wrong. Can you email be the relevant parts of the app (the imported controller and the one being imported)? I do not believe your scaling problem was with the web2py wsgiserver. If I remember you had more than 100 requests per second on a singl

[web2py:21892] Re: Importing modules from controller folder

2009-05-15 Thread Yarko Tymciurak
On Fri, May 15, 2009 at 2:23 AM, Voltron wrote: > . > > I still use Web2py for one domain, its just that my boss was not too > happy with the problems we had deploying the web2py applications > (CherryPY server not scaling, FCGI). We are using a PHP framework for > those domains( 3) instead >

[web2py:21893] Re: python path in web2py files

2009-05-15 Thread Kacper Krupa
yep, i told about it: http://groups.google.com/group/web2py/browse_thread/thread/71bb1897b47c153f/749923b3c7e7d791?q=#749923b3c7e7d791 On 15 Maj, 10:22, virhilo wrote: > I think the python path in web2py files stould be: > /usr/bin/env python > instead of /usr/bin/python > > I make a patch for

[web2py:21894] Re: python path in web2py files

2009-05-15 Thread Yarko Tymciurak
There is some good discussion (pros/cons) here: http://en.wikipedia.org/wiki/Env On Fri, May 15, 2009 at 8:09 AM, Kacper Krupa wrote: > > yep, i told about it: > > http://groups.google.com/group/web2py/browse_thread/thread/71bb1897b47c153f/749923b3c7e7d791?q=#749923b3c7e7d791 > > > On 15 Maj, 10

[web2py:21895] Re: python path in web2py files

2009-05-15 Thread Yarko Tymciurak
... the real question is: to what extent does this matter when you are running: $ python2.6 web2py.py -a 'hello' Will any of the headers in these scripts matter at all? On Fri, May 15, 2009 at 8:34 AM, Yarko Tymciurak wrote: > There is some good discussion (pros/cons) here: > http://en.wikiped

[web2py:21896] Re: python path in web2py files

2009-05-15 Thread Yarko Tymciurak
put another way, does it make more sense (perhaps) to remove the "shebang" from the front of the scripts altogether? On Fri, May 15, 2009 at 8:37 AM, Yarko Tymciurak wrote: > ... the real question is: to what extent does this matter when you are > running: > $ python2.6 web2py.py -a 'hello

[web2py:21897] Re: Can't get web2py to run as Windows service

2009-05-15 Thread mdipierro
On May 15, 1:51 am, weheh wrote: > Iceberg mentions: > > On May 7, 10:12 am, Iceberg wrote: > > > So the following trick might be worth looking at. I build another > > web2py.exe by py2exe, to hide the web2py.exe 's console when running. > > In this way, it runs almost like a background servic

[web2py:21898] custom crud

2009-05-15 Thread annet
I am working on a custom crud function. In my model I have got the following table: db.define_table('adres', SQLField('bedrijf', db.bedrijf, default='', notnull=True), SQLField('adressoort', length=30, default='Vestigingsadres', notnull=True), SQLField('straat', length=42, default=''

[web2py:21899] Re: custom crud

2009-05-15 Thread Kacper Krupa
before form=crud.create(): db.adres.bedrijf.default = auth.user.bedrijf On 15 Maj, 16:08, annet wrote: > I am working on a custom crud function. > > In my model I have got the following table: > > db.define_table('adres', >     SQLField('bedrijf', db.bedrijf, default='', notnull=True), >     SQL

[web2py:21900] Re: bug in form behavior?

2009-05-15 Thread DenesL
@mgbelisle Nice solvers. @Massimo web2py is (correctly IMO) building request.vars.field as a list from the three INPUTs, so for consistency I would expect form.vars.field to be an exact copy after accepts. There is nothing in the w3.org specs against the use of equally named INPUT controls outsid

[web2py:21901] authorization

2009-05-15 Thread annet
I defined a custom user table and created a few users. Then, I created two groups: core and site, made the users members of these groups and assigned permissions to the groups. Doing this raised the following questions: Is it possible to combine decorators? e.g. executing a function requires logi

[web2py:21902] Re: custom crud

2009-05-15 Thread annet . vermeer
Kacper, Thanks for your reply, it solved the issue of: onvalidation=lambda form: form.vars.bedrijf=auth.user.bedrijf returning an error. What about the other issues? Kind regards, Annet --~--~-~--~~~---~--~~ You received this message because you are subscribed

[web2py:21903] Re: Importing modules from controller folder

2009-05-15 Thread DenesL
On May 15, 8:57 am, mdipierro wrote: > Voltron, I do that all the time so something else is wrong. Massimo, what is what you do all the time? import from the controllers folder or import from modules?. It seems to me that in web2py's design the controllers folders was not meant for this, it has

[web2py:21904] Re: authorization

2009-05-15 Thread mdipierro
On May 15, 9:52 am, annet wrote: > I defined a custom user table and created a few users. Then, I created > two groups: core and site, made the users members of these groups and > assigned permissions to the groups. Doing this raised the following > questions: > > Is it possible to combine decora

[web2py:21905] Re: Importing modules from controller folder

2009-05-15 Thread mdipierro
I import modules from the app all the time. I normally put them in modules/ but it makes no difference if they are in controllers/. I would not do it this way not nothing technically prevents it if you have the __init__.py file. You can define forms in modules and they will be visible everywehere

[web2py:21906] Re: new Auth in trunk

2009-05-15 Thread mdipierro
Forget the patch. This is fixed in trunk. On May 14, 10:48 am, mdipierro wrote: > OK. can you send me a patch? > > Massimo > > On May 14, 10:13 am, Álvaro Justen [Turicas] > wrote: > > > On Thu, May 14, 2009 at 11:49 AM, mdipierro wrote: > > > YES for > > >         self.settings.submit_button

[web2py:21907] Re: bug in form behavior?

2009-05-15 Thread mdipierro
This is not fixed in trunk. Please check. I hope it did not break anything else. On May 14, 11:01 pm, "mgbeli...@gmail.com" wrote: > Thanks massimo.  At your convenience of course.  I will usually give > different names, but the identical field names helped me out in this > apphttps://www.lemurs

[web2py:21908] Re: bug in form behavior?

2009-05-15 Thread mdipierro
This is fixed too. Can you please check? Thanks Massimo On May 15, 9:20 am, DenesL wrote: > @mgbelisle > Nice solvers. > > @Massimo > web2py is (correctly IMO) building request.vars.field as a list from > the three INPUTs, so for consistency I would expect form.vars.field to > be an exact copy

[web2py:21909] Extending the framework to identify between local and appengine instances

2009-05-15 Thread Carl
I need different application behaviour between instances running on appengine and running locally. e.g., I'm embedding the domain name in emails: either: http://127.0.0.1:8000/app or http://1.latest.domainname.com/app or http://www.domainname.com/app where in web2py would you recommend I set "

[web2py:21910] Re: Importing modules from controller folder

2009-05-15 Thread Álvaro Justen [Turicas]
On Fri, May 15, 2009 at 4:23 AM, Voltron wrote: > Hi Massimo! > > Yes, the problem still persists, it is not possible to import a > package or module from a subdirectory in the controller folder, even > when I placed an "__init__.py file in almost every folder I don't understand why you can't im

[web2py:21911] Re: custom crud

2009-05-15 Thread mdipierro
Please try trunk. I am using that and it works for me. On May 15, 10:00 am, annet.verm...@gmail.com wrote: > Kacper, > > Thanks for your reply, it solved the issue of: onvalidation=lambda > form: form.vars.bedrijf=auth.user.bedrijf returning an error. > > What about the other issues? > > Kind reg

[web2py:21912] Re: Extending the framework to identify between local and appengine instances

2009-05-15 Thread mdipierro
This is there since 1.61.4 from gluon.settings import settings if settings.web2py_runtime=='gae:development': pass if settings.web2py_runtime=='gae:production' pass On May 15, 10:41 am, Carl wrote: > I need different application behaviour between instances running on > appengine and runni

[web2py:21913] Re: custom crud

2009-05-15 Thread annet . vermeer
I replaced the following validators from the table definition: db.adres.bedrijf.writable=False db.adres.bedrijf.readable=False and changed the bedrijf field definition to read like: SQLField('bedrijf', db.bedrijf, writable=False, readable=False, default='', notnull=True), The adres.bedrijf fi

[web2py:21914] Re: Extending the framework to identify between local and appengine instances

2009-05-15 Thread Carl
nailed it! thanks On May 15, 4:50 pm, mdipierro wrote: > This is there since 1.61.4 > > from gluon.settings import settings > if settings.web2py_runtime=='gae:development': >    pass > if settings.web2py_runtime=='gae:production' >    pass > > On May 15, 10:41 am, Carl wrote: > > > > > I need d

[web2py:21915] Re: custom crud

2009-05-15 Thread mdipierro
I think you just had a typo. It works both ways for me. On May 15, 10:54 am, annet.verm...@gmail.com wrote: > I replaced the following validators from the table definition: > > db.adres.bedrijf.writable=False > db.adres.bedrijf.readable=False > > and changed the bedrijf field definition to read l

[web2py:21916] form[][][].append()

2009-05-15 Thread annet
I have a form to which I want to customize. def apply_cms(): response.functionname=T('Application form CMS') response.image=URL(r=request,c='static',f='media/cms/banner.png') form=form_factory(SQLField('bedrijfsnaam',label='Bedrijfsnaam *',requires=IS_NOT_EMPTY()),\ SQLField('kvk

[web2py:21917] Re: python path in web2py files

2009-05-15 Thread virhilo
Yes, you right some(most) of that files are never executed, them only used as modules, but another are executed(web2py.py, fcgihandler.py etc.) so them should have correct python parth in "shebang". On 15 Maj, 15:39, Yarko Tymciurak wrote: > put another way, does it make more sense (perhaps

[web2py:21918] sqlite and threading

2009-05-15 Thread Kacper Krupa
Hi, I've written application which creates another thread and do things inside it. But why i can't use ORM in it? I'm using sqlite3 and i always get: ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 28329984 and this is

[web2py:21919] Re: form[][][].append()

2009-05-15 Thread mdipierro
Answers in text below On May 15, 11:04 am, annet wrote: > I have a form to which I want to customize. > > def apply_cms(): >     response.functionname=T('Application form CMS') >     response.image=URL(r=request,c='static',f='media/cms/banner.png') >     form=form_factory(SQLField('bedrijfsnaam'

[web2py:21920] gzip response.

2009-05-15 Thread LBarret
in this thread http://groups.google.com/group/web2py/browse_thread/thread/cca9cf9e5f9176dd?pli=1, massimo said : "data should (should?) be transmitted zipped by the web server. cherrpypy's wsgiserver cannot do it but apache does it. It is not clear that there is a real benefit since it takes tim

[web2py:21921] Re: python path in web2py files

2009-05-15 Thread Yarko Tymciurak
as I mentioned, see the discussion on http://en.wikipedia.org/wiki/Env using env can lead to right, or wrong that is, what you intended or not... It is more convenient perhaps for general development use; more dangerous perhaps for deployment use we need to think about this I think...

[web2py:21922] Re: Can't get web2py to run as Windows service

2009-05-15 Thread weheh
Looks like I finally got it to work, but it took some help from knowledgable Windows people. I'll try to decipher what happened and see if there's anything I can report that'll make it easier for the next person who comes this way. --~--~-~--~~~---~--~~ You received

[web2py:21923] Re: form[][][].append()

2009-05-15 Thread DenesL
Annet, I suggest you use Firefox with the Web Developer and Firebug add-ons. With the first one use: outline - outline tables - table cells, to visualize how the form is structured. With Firebug, among many things, you can examine any HTML, CSS, and JS code, and even make changes for testing purp

[web2py:21924] Re: python path in web2py files

2009-05-15 Thread mdipierro
Yarko, I think the link you sent made a good point for the switch. So I changed it in trunk. On May 15, 12:25 pm, Yarko Tymciurak wrote: > as I mentioned, see the discussion onhttp://en.wikipedia.org/wiki/Env > > using env can lead to right, or wrong  that is, what you intended or > not...

[web2py:21925] Re: sqlite and threading

2009-05-15 Thread Scott Hunter
I hit this one a while back; its a limitation of SQLite. * You could create a new process to access the DB, but that's probably not very safe (they really mean the Lite part of the name!) * You could switch to a DB, like MySQL, which does support concurrent access * You could have your thread a

[web2py:21926] Re: sqlite and threading

2009-05-15 Thread mdipierro
This is a bit can of worms. Not all database divers are thread safe (in the sense that they allows you to use the same open connection safely in multiple threads). sqlite is not thread safe and to prevent problems it blocks access from a different thread than the one that created the thread. The

[web2py:21927] Re: gzip response.

2009-05-15 Thread mdipierro
wsgiserver does not serve zipped pages but: - if you download web2py apps they are not zipped in .w2p files before being served (this is a change) - it does not matter that wsgiserver does not do it since in production one should use mod_wsgi and that will do the zipping - It is still not clear to

[web2py:21928] Re: Can't get web2py to run as Windows service

2009-05-15 Thread mdipierro
please do! On May 15, 12:45 pm, weheh wrote: > Looks like I finally got it to work, but it took some help from > knowledgable Windows people. I'll try to decipher what happened and > see if there's anything I can report that'll make it easier for the > next person who comes this way. --~--~-

[web2py:21929] Re: gzip response.

2009-05-15 Thread AchipA
I did a fair amount of testing on a couple of systems and the numbers say that in real life, it's quite a significant gain except for some very specific cases. I'd say the article you quoted concludes the same. Even if the latency does not improve for ONE client, the next one will benefit as the *

[web2py:21930] Re: Can't get web2py to run as Windows service

2009-05-15 Thread carlo
usually easy to debug: look into the Event Viewer and post the error log. carlo On 15 Mag, 21:12, mdipierro wrote: > please do! > > On May 15, 12:45 pm, weheh wrote: > > > Looks like I finally got it to work, but it took some help from > > knowledgable Windows people. I'll try to decipher what

[web2py:21931] open issues?

2009-05-15 Thread mdipierro
Except for the web2py-as-windows as service issue, is there anything else I fogot to fix? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@goog

[web2py:21932] Re: open issues?

2009-05-15 Thread mdipierro
BTW... you can test the latest at http://www.web2py.com/examples/static/1.62rc2/web2py_src.zip http://www.web2py.com/examples/static/1.62rc2/web2py_win.zip http://www.web2py.com/examples/static/1.62rc2/web2py_osx.zip On May 15, 3:40 pm, mdipierro wrote: > Except for the web2py-as-windows as ser

[web2py:21933] Re: psycopg2-2.0.10 install linux ,help me

2009-05-15 Thread Tom
Hi, wengfei. I had the same error message trying to install psycopg2 using easy_install. I'm using Ubuntu 8.04. I tried to install some packages, as libpq-dev recommended by Marek, but other packages were necessary. Then I installed psycopg2 using apt-get: $ sudo apt-get install python-psycopg

[web2py:21934] Re: gzip response.

2009-05-15 Thread Álvaro Justen [Turicas]
On Fri, May 15, 2009 at 4:30 PM, AchipA wrote: > I did a fair amount of testing on a couple of systems and the numbers > say that in real life, it's quite a significant gain except for some > very specific cases. I'd say the article you quoted concludes the > same. Even if the latency does not im

[web2py:21935] Web2py in Wild

2009-05-15 Thread zeya
Hi, New member to the group. I'm wondering if there is any LIVE site is powered web2py. Many Thanks. zy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send ema

[web2py:21936] Re: Web2py in Wild

2009-05-15 Thread mdipierro
These are some public ones that say it http://www.appliedstacks.com/NewestFirst/web2py Most deployments are within intranets. Massimo On May 15, 9:10 pm, zeya wrote: > Hi, > > New member to the group. I'm wondering if there is any LIVE site is > powered web2py. > > Many Thanks. > > zy --~--~-

[web2py:21937] CRUD

2009-05-15 Thread JohnMc
I am curious. From the documentation I read on CRUD it appears to manage everything about a database but creating the database to begin with. A) Is that possible with executesql() ? B) Was there a reason for not providing a createdb() capability? Thanks. --~--~-~--~~~

[web2py:21938] Re: CRUD

2009-05-15 Thread mdipierro
If you use sqlite db=SQLDB('sqlite://storage.sqlite') there is nothing to do, web2py will create it. If you use GAE db=GQLDB() also there is nothing to do. If you use any of the other database engines, the actual database cannot be created in SQL but using the specific functions (crea