[web2py] Re: one to many relationship but Foreign key as non-id,unique field.

2010-08-08 Thread qqsaqq
as I understand this, the DAL always uses the id field for referencing in a one to many relationship. And: you don't link to a certain field (EmailID) but to a record of your emails table. see http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables On Aug 8, 8:00 am, Phyo Arka

Re: [web2py] Re: one to many relationship but Foreign key as non-id,unique field.

2010-08-08 Thread Phyo Arkar
Yes i understand that 1 to Many do not link to Field but Record but i need to Reference to a Field which is not id . so with that i can set two primary keys but i want to reference to EmailID (which is not auto increment Integer but a md5sum , string , Unique) . Is that possible? On Sun, Aug 8,

[web2py] Re: generate CSV file with multiple sheets

2010-08-08 Thread Neveen Adel
Hello, am using xlwt module to create xls file with multiple sheets and i want to display Content disposition with the created file. wbk = xlwt.Workbook(encoding='utf-8') sheet = workbook.add_sheet('sheet1') and then response.headers['Content-Type'] = \ gluon.contenttype.contenttype('.xl

[web2py] Re: generate CSV file with multiple sheets

2010-08-08 Thread Neveen Adel
Hello, am using xlwt module to create xls file with multiple sheets and i want to display Content disposition with the created file. wbk = xlwt.Workbook(encoding='utf-8') sheet = workbook.add_sheet('sheet1') and then response.headers['Content-Type'] = \ gluon.contenttype.contenttype('.xl

[web2py] Re: generate CSV file with multiple sheets

2010-08-08 Thread Neveen Adel
Hello Kenneth, sorry i have just seen your message now. you can follow the following link it is a great one, i followed it: http://scienceoss.com/write-excel-files-with-python-using-xlwt/ Thanks Neveen

[web2py] Help with Paypal Mass Payment, API

2010-08-08 Thread Alexandre Andrade
Someone has experience with Paypal Mass Payment API? I want a working implementation to web2py and want pay to develop it. -- Atenciosamente -- = Alexandre Andrade Hipercenter.com

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Hi Massimo, Yes this time I was running it from a fresh installed ubuntu server so PostgreSQL was using the default port. I changed the pool_size to 0 and tried a couple of combinations. Maybe it is a configuration problem with my PostgreSQL? 1. If I run: sudo -u www-data python www-data/web2py

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Whoops, I was using local all web2pymd5 in pg_hba.conf. /Zhe On Aug 8, 1:32 pm, Zhe Li wrote: > Hi Massimo, > > Yes this time I was running it from a fresh installed ubuntu server so > PostgreSQL was using the default port. > > I changed the pool_size to 0

Re: [web2py] Re: Is there a way how to specifiy, which controller act as default?

2010-08-08 Thread Phyo Arkar
+1 On Sat, Aug 7, 2010 at 12:00 AM, mr.freeze wrote: > Not another config file, just another config option. Why have the > overhead and complexity of a routes regex when you could just set it > explicitly in an existing config file? Just seems more straightforward > and user friendly to me. > >

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: > I use version 1.82.1 (latest) and this seems not to work > > ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), > > > for simple site.com getting error > > site - is another name :) Is this 1.82.1 or the trunk?

[web2py] Position of a row in a query?

2010-08-08 Thread szabba
Is there a way to determine at what position in a query a row resides? This would be helpful for me to have something similiar to list's index method that I could call on a query.

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: > I use version 1.82.1 (latest) and this seems not to work > > ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), > > > for simple site.com getting error > > site - is another name :) I think I see the problem, but I'm not sure what you're tryin

Re: [web2py] routes problem

2010-08-08 Thread Jonathan Lundell
On Aug 7, 2010, at 11:16 PM, elffikk wrote: > I use version 1.82.1 (latest) and this seems not to work > > ('(.*):https?://(.*)site\.com:(.*)/(.*)', '/site/$4'), > > > for simple site.com getting error > > site - is another name :) From the manual (chapter 4): [remote address]:[protocol]://[

[web2py] testing routes.py patterns

2010-08-08 Thread Jonathan Lundell
I've been advocating the use of doctests in routes.py to debug problems. Here's another doctest you can use (I'll send a patch to Massimo that adds an example). >>> compile_re('.*http://otherdomain.com.* (?P.*)', '/app/ctr\g')[0].pattern '^.*http://otherdomain.com.* (?P.*)$' >>> comp

Re: [web2py] testing routes.py patterns

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 8:31 AM, Jonathan Lundell wrote: > I've been advocating the use of doctests in routes.py to debug problems. > Here's another doctest you can use (I'll send a patch to Massimo that adds an > example). > compile_re('.*http://otherdomain.com.* (?P.*)', '/app/ctr\g')[0

[web2py] Re: Web2py book software feature request

2010-08-08 Thread b00m_chef
This wasn't so much specific to web2py, but rather to the book app itself...especially to make it attractive to use outside of web2py. On Aug 6, 12:37 am, mdipierro wrote: > This is how things are now: > - you can register and you can submit comments > - you can ask me to edit the book and I ca

[web2py] Re: one to many relationship but Foreign key as non-id,unique field.

2010-08-08 Thread mdipierro
No. But you can enforce the reference at the web2py level with the IS_IN_DB validator. On Aug 8, 2:36 am, Phyo Arkar wrote: > Yes i understand that 1 to Many do not link to Field but Record but i need > to Reference to a Field which is not id  . > so with that i can set two primary keys but i wan

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread mdipierro
aha! I think it is a problem with permissions of contect of databases folder. Make sure the apache/www-data user has permissions to read and write On Aug 8, 6:32 am, Zhe Li wrote: > Hi Massimo, > > Yes this time I was running it from a fresh installed ubuntu server so > PostgreSQL was using the d

[web2py] Re: LOAD... and jquerytools

2010-08-08 Thread mdipierro
Please clarify what you mean by does not work. Did you try firebug? is the ajax call executed? Do you get a response? If so, it is a JS problem. On Aug 8, 7:19 am, JmiXIII wrote: > Hello ! > > Here is a view in which I am using LOAD helper > I have put {{=LOAD('default','index.load')}} N°# in sev

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Hi, I changed local all web2pyident to local all allmd5 in pg_hba.conf, but it still can't connect to it. but i can connect to the database using: sudo -u www-data psql -h localhost labdb -U web2py Does that mean www

[web2py] Re: JS question

2010-08-08 Thread mdipierro
I would do this (on top of the scaffolding app) 1) model/db_rsvp.py db.define_table('event', Field('name',requires=IS_NOT_EMPTY()), Field('start_time','datetime'), Field('location'), Field('posted_by',db.auth_user,default=auth.user_id,writable=False)) db.define_table('rsvp', Field('

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Just an interesting note. Yesterday after the fresh re-installation, I tried to run "python web2py.py -a 0 -i 0.0.0.0" without psycog2, it gave me an "unable to connect to db" too, but didn't say that psycopg2 is missing. Can it be the reason here? But I installed psycopg2 with apt-get it should se

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Just now I found that it was using python2.5 and python2.5-psycopg2 in the script, but in ubuntu 10.04 they have been removed from repository. I will try to re-install it manually. Cheers, Zhe On Aug 8, 8:27 pm, Zhe Li wrote: > Just an interesting note. Yesterday after the fresh re-installation,

[web2py] Re: LOAD... and jquerytools

2010-08-08 Thread JmiXIII
Well in fact it does not render for N°1=>N°3 in my code Yet I'm not used to using javascript and ajax and does not know firebug enough. But here is the code rendered : Date/Heure controle 1 controle 2 Hello World N°1

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread Zhe Li
Finally!! It works now! I switched my dev server to ubuntu 9.10 and everything works now! I couldn't find a repository for python2.5- psycopg2 in ubuntu 10.04 so I didn't try that. Regards, Zhe On Aug 8, 8:57 pm, Zhe Li wrote: > Just now I found that it was using python2.5 and python2.5-psycopg2

[web2py] Why is routes.py not recommended for production?

2010-08-08 Thread mwolfe02
According to the web2py book, routes.py should not be used in production environment (http://web2py.com/book/default/chapter/04? search=lighttpd). Instead, Apache/lighttpd web server rewrite is suggested. I assumed this was due to some overhead that using routes.py would incur. However, massimo's

Re: [web2py] Why is routes.py not recommended for production?

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 2:35 PM, mwolfe02 wrote: > According to the web2py book, routes.py should not be used in > production environment (http://web2py.com/book/default/chapter/04? > search=lighttpd). Instead, Apache/lighttpd web server rewrite is > suggested. > > I assumed this was due to some overh

[web2py] Re: LOAD... and jquerytools

2010-08-08 Thread JmiXIII
Change cdn.jquerytools.org to jqueryui , it works fine. On 8 août, 22:04, JmiXIII wrote: > Well in fact it does not render for N°1=>N°3 in my code > Yet I'm not used to using javascript and ajax and does not know > firebug enough. > But here is the code rendered : > >     >         >          

Re: [web2py] Why is routes.py not recommended for production?

2010-08-08 Thread Vasile Ermicioi
- very *little overhead* - routes.py is loaded only when web2py starts and regex patterns are compiled, and this is just a string operation (regex) on a short string (url) why I prefer to rewrite urls in web2py: - *no external dependencies*, like mod_rewrite - *portability - *is mod rewrite the s

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-08 Thread mdipierro
:-) On Aug 8, 3:31 pm, Zhe Li wrote: > Finally!! It works now! I switched my dev server to ubuntu 9.10 and > everything works now! I couldn't find a repository for python2.5- > psycopg2 in ubuntu 10.04 so I didn't try that. > > Regards, > Zhe > > On Aug 8, 8:57 pm, Zhe Li wrote: > > > Just now I

[web2py] Re: Why is routes.py not recommended for production?

2010-08-08 Thread mdipierro
Jonathan is right. That sentence is also a relic of older version of the manual when routes was not very well tested. I will correct or move those statements. On Aug 8, 4:48 pm, Jonathan Lundell wrote: > On Aug 8, 2010, at 2:35 PM, mwolfe02 wrote: > > > > > According to the web2py book, routes.py

[web2py] Re: JS question

2010-08-08 Thread mdipierro
Actually your questions gave me some ideas on how to simplify the web2py syntax in using components. With the code in trunk you can now rewrite the component {{=LOAD('rsvp','rsvp',ajax=True)}} as follows: def rsvp(): """ self contained component to handle RSVP requests and notificaitons

[web2py] Autocompletion Widget

2010-08-08 Thread villas
I have the following requirements: 1) The widget to show the 'name' but save the 'id' 2) The widget to reveal the fields 'name' plus 'town' in the drop down selection. The built-in autocomplete widget provides 1) but I cannot see how to do 2). The code in sqlhtml.py seems rather complex. I trie

[web2py] routes_in 153, me 0

2010-08-08 Thread Andrew Thompson
I can not wrap my head around routes_in. I'm attempting to host 3 sites via lighttpd and fcgihandler.py (is this the best way?) I ripped this mostly from a mdpierro post, and tweaked it for my domain, but I'm just not making progress: ('(.*):https?://(.*)mysite\.com:(.*) /favicon.ico', '/

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Thadeus Burgess
('.*:https?://dashboard\.thadeusb\.com:.* /admin(?P.*)', '/admin\g'), ('.*:https?://thadeusb\.com:.* /(?P.*)', '/blogitizor/\g'), This is what I am currently using. -- Thadeus On Sun, Aug 8, 2010 at 7:10 PM, Andrew Thompson wrote: >  I can not wrap my head around routes_in. I'm attempti

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 5:10 PM, Andrew Thompson wrote: > I can not wrap my head around routes_in. I'm attempting to host 3 sites via > lighttpd and fcgihandler.py (is this the best way?) > > I ripped this mostly from a mdpierro post, and tweaked it for my domain, but > I'm just not making progress:

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Thadeus Burgess
The routes.example.py contains some unit tests. I have found this to be the most effective way of testing my routes to make sure they do what I want. -- Thadeus On Sun, Aug 8, 2010 at 7:30 PM, Jonathan Lundell wrote: > On Aug 8, 2010, at 5:10 PM, Andrew Thompson wrote: > >> I can not wrap my

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 5:33 PM, Thadeus Burgess wrote: > The routes.example.py contains some unit tests. I have found this to > be the most effective way of testing my routes to make sure they do > what I want. Also, I sent a note (yesterday?) to this list on how to use compile_re() in doctest to se

[web2py] Re: Autocompletion Widget

2010-08-08 Thread mdipierro
You must have computed field that contains the contend you want to use 'name + town' On Aug 8, 7:06 pm, villas wrote: > I have the following requirements: > > 1) The widget to show the 'name' but save the 'id' > 2) The widget to reveal the fields 'name' plus 'town' in the drop down > selection. >

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Andrew Thompson
On 8/8/2010 8:30 PM, Jonathan Lundell wrote: On Aug 8, 2010, at 5:10 PM, Andrew Thompson wrote: I can not wrap my head around routes_in. I'm attempting to host 3 sites via lighttpd and fcgihandler.py (is this the best way?) I ripped this mostly from a mdpierro post, and tweaked it for my dom

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 6:00 PM, Andrew Thompson wrote: > On 8/8/2010 8:30 PM, Jonathan Lundell wrote: >> On Aug 8, 2010, at 5:10 PM, Andrew Thompson wrote: >> >>> I can not wrap my head around routes_in. I'm attempting to host 3 sites via >>> lighttpd and fcgihandler.py (is this the best way?) >>>

[web2py] Book in Italian, Spanish, Portuguese, Chinese and Russian (sort of)

2010-08-08 Thread mdipierro
I have been playing with google translate and I managed to get a complete translation of the book in Italian, Spanish, Portuguese, Chinese and Russian. DISCLAMER: - The translation is bad but for non-english speakers, it is still better than the english version. - The translation was completely a

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Andrew Thompson
On 8/8/2010 8:33 PM, Thadeus Burgess wrote: The routes.example.py contains some unit tests. I have found this to be the most effective way of testing my routes to make sure they do what I want. Perhaps email clients munged it, but I have an existing filter_url doctest that seems to indicate th

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Andrew Thompson
On 8/8/2010 9:10 PM, Jonathan Lundell wrote: Is it possible that lighttpd is altering the URL enough that it doesn't match what you've got in routes.py? Perhaps. I've got to figure out how to test for that. -- Andrew Thompson http://aktzero.com/

Re: [web2py] routes_in 153, me 0

2010-08-08 Thread Jonathan Lundell
On Aug 8, 2010, at 6:15 PM, Andrew Thompson wrote: > On 8/8/2010 9:10 PM, Jonathan Lundell wrote: >> Is it possible that lighttpd is altering the URL enough that it doesn't >> match what you've got in routes.py? > > Perhaps. I've got to figure out how to test for that. I'll try to send Massimo

Re: [web2py] Book in Italian, Spanish, Portuguese, Chinese and Russian (sort of)

2010-08-08 Thread Zoom.Quiet
On Mon, Aug 9, 2010 at 09:10, mdipierro wrote: > I have been playing with google translate and I managed to get a > complete translation of the book in Italian, Spanish, Portuguese, > Chinese and Russian. > e that realy can not read by Chinese...; in fact we base web2py manual ed2,start trans

Re: [web2py] Book in Italian, Spanish, Portuguese, Chinese and Russian (sort of)

2010-08-08 Thread Bruno Rocha
Portuguese version is really funny :o| , absolutelly wrong, as portuguese is a "strange", non semantic and complex language. Look how the Python Chapter were translated back into english.. - Python is a general purpose, and about programming of very high level languages. By the way, this is ver

[web2py] Re: Web2py Application Exhibition -- Winners!

2010-08-08 Thread Rahul
On Aug 7, 3:09 pm, Vasile Ermicioi wrote: > me too Actually i have written a website and also have an application (Ticket Management) written and gelled in it. Its far more than just ticket management app, it encompasses patch management, change mgt, complete integration with emails, graphs a

[web2py] Re: JS question

2010-08-08 Thread Rob
Massimo, You go above and beyond! Thanks you so much for the through explanation. This second version is much much cleaner then the version before it - thanks for hacking trunk to add the change! Now I have to integrate it and make sure I understand how everything works! -Rob On Aug 8, 4:32 p