[web2py:14451] Default lang for i18n and the code shared among all controllers

2009-01-02 Thread Jaroslaw Zabiello
I do not like the way web2py distinguish 'en' and 'en-en' as two different languages, so I wrote a simple code which fix it. lang = request.env.http_accept_language.split(',')[0].split(';') [0].split('-')[0] if lang not in [all_available_languages]: lang = DEFAULT_LANG T.force(lang) I have also

[web2py:14450] Re: open source organization again

2009-01-02 Thread billf
OK - that's a good idea :-) On Jan 2, 10:40 am, mdipierro wrote: > This is a good point but not something we really need to worry at the > beginning. > About 100 people on this list have contributed to web2py with > comments, questions, patches. The association should recognize this. > Once we

[web2py:14449] Re: Proposal: MVC separation - son of custom views

2009-01-02 Thread billf
On Jan 3, 4:10 am, "Yarko Tymciurak" wrote: > mmm > > On Fri, Jan 2, 2009 at 2:06 AM, Yarko Tymciurak wrote: > > Hi Bill - > > Sorry - I was sort of in shock when read my own comments (remind me not to > > right when I'm tired!) - but I am glad you could understand them. > > to write

[web2py:14448] routes problem

2009-01-02 Thread Jaroslaw Zabiello
What am I doing wrong? For routes.py: routes_in=( ('/admin(?P.*)', '/admin\g'), ('.*:/favicon.ico','/homepage/static/favicon.ico'), ('.*:/robots.txt','/homepage/static/robots.txt'), ('/myapp/szukaj)', '/myapp/search/index'), ) routes_out=( ('/myapp/search/index)', '/myapp/sz

[web2py:14447] Re: Weak API doc

2009-01-02 Thread Wes James
Go to: http://mdp.cti.depaul.edu/examples/static/epydoc/index.html on the left click on gluon.html then scroll the right frame down until you see URL(... -wj On Fri, Jan 2, 2009 at 9:25 PM, Jaroslaw Zabiello wrote: > > I try to find what available options for URL() function and I thought > t

[web2py:14446] Re: Weak API doc

2009-01-02 Thread Yarko Tymciurak
(sorry for the redundant lines...) On Fri, Jan 2, 2009 at 10:48 PM, Yarko Tymciurak wrote: > This will help a little: > http://mdp.cti.depaul.edu/examples/static/epydoc/index.html > > The tutorial at http://mdp.cti.depaul.edu/examples/static/cookbook.pdf >

[web2py:14445] Re: Weak API doc

2009-01-02 Thread Yarko Tymciurak
This will help a little: http://mdp.cti.depaul.edu/examples/static/epydoc/index.html The tutorial at http://mdp.cti.depaul.edu/examples/static/cookbook.pdf will help some too; There are more examples and discussion in the book, but this sho

[web2py:14444] Weak API doc

2009-01-02 Thread Jaroslaw Zabiello
I try to find what available options for URL() function and I thought they would be defined in API at http://mdp.cti.depaul.edu/examples/default/api but I was wrong. That API doc is very poor. All I found is URL.__call__ which does not tell me anything. Even worse, it points to another stupid pa

[web2py:14443] Re: Proposal: MVC separation - son of custom views

2009-01-02 Thread Yarko Tymciurak
mmm On Fri, Jan 2, 2009 at 2:06 AM, Yarko Tymciurak wrote: > Hi Bill - > Sorry - I was sort of in shock when read my own comments (remind me not to > right when I'm tired!) - but I am glad you could understand them. > to write when I'm tired!). . > >> 2) Comments are not part

[web2py:14442] Re: Many to Many (sort of)

2009-01-02 Thread Yarko Tymciurak
On Fri, Jan 2, 2009 at 9:03 PM, sudhakar m wrote: > My mistake. It should be > > db.define_table("Ground", > SQLField("won_by", db.Team), > # was: SQLField("Match_ids", *db.Match*) SQLField("Match_ids", *"text"*)) I think you mean to have SQLField("Match_ids", integer) as th

[web2py:14441] Re: Many to Many (sort of)

2009-01-02 Thread sudhakar m
My mistake. It should be db.define_table("Ground", SQLField("won_by", db.Team), SQLField("Match_ids", *"text"*)) db.define_table("Match", SQLField("Ground_id", db.Ground), SQLField("win_margin", "string"), SQLField("no", "integer")) db.Match.Ground_id.requires=

[web2py:14440] Re: Many to Many (sort of)

2009-01-02 Thread sudhakar m
Referencing the table before definition causes error. Following test case fails. db.define_table("Ground", SQLField("won_by", db.Team), SQLField("Match_ids", *db.Match*)) db.define_table("Match", SQLField("Ground_id", *db.Ground*), SQLField("win_margin", "string"), S

[web2py:14439] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread rctay
cool, look forward to when you do settle on the naming. On Jan 3, 1:20 am, mdipierro wrote: > > are we just stuck with specifying/not specifiying [...] for 'requires'? > > yes. > > I agree there are alternatives but they would break backward > compatibility. > > You can override this behavior us

[web2py:14438] Re: Help with KeyError

2009-01-02 Thread LB22
Just to update, that worked like a charm. Thanks again for your help! :o) On 2 Jan, 22:29, LB22 wrote: > OH man! That's makes sense! > > "FYI, all the models are executed in alphabetical order at the start > of > each request... > > I didn't realise this. If I had, I wouldn't have added that lin

[web2py:14437] Re: Help with KeyError

2009-01-02 Thread LB22
OH man! That's makes sense! "FYI, all the models are executed in alphabetical order at the start of each request... I didn't realise this. If I had, I wouldn't have added that line. I'm gonna try removing it. Thank you :o) LB On 2 Jan, 22:26, Robin B wrote: > Try removing this line from the c

[web2py:14436] Re: Help with KeyError

2009-01-02 Thread Robin B
Try removing this line from the controller: dk2=SQLDB("mysql://root:passw...@127.0.0.1:3306/dk2") It was redefining the dk2 that was defined in the models. FYI, all the models are executed in alphabetical order at the start of each request, then the symbols from the models are automatically ava

[web2py:14435] Re: Help with KeyError

2009-01-02 Thread LB22
Sorry, you're right. db(dk2,'jusers).insert was one of many desperate attempts at a solution. I forgot I hadn't changed it back. So, i'll post the controller and model again in the original form... Model: from datetime import datetime, date, time today = date.today() now = datetime.utcnow()

[web2py:14434] Re: Help with KeyError

2009-01-02 Thread Robin B
As far as variable references, are dk2, dk, and db all the same database? There is something funny about: db(dk, 'jusers').insert(...) should it be: dk2.jusers.insert(...) Robin On Jan 2, 12:44 pm, LB22 wrote: > Hi there, > > I'm fairly new to both python and web2py, and I've run into a pro

[web2py:14433] Help with KeyError

2009-01-02 Thread LB22
Hi there, I'm fairly new to both python and web2py, and I've run into a problem that I just can't seem to get around. I'm hoping someone can help. If anymore info is need, please let me know. So, I keep getting this error: Traceback (most recent call last): File "gluon\restricted.pyc", line 6

[web2py:14432] Re: Many to Many (sort of)

2009-01-02 Thread Jon
Awesome! I think this may stem from an earlier discussion we had on the IS_IN_DB and my 'noob request for a many-to-many? You rock Massimo. On Dec 31 2008, 7:57 am, mdipierro wrote: > BTW... it works great with this jquery plugin: > > http://lab.arc90.com/tools/jquery_multiselect/ > > On Dec 30

[web2py:14431] Helper for Custom Forms, inside controller

2009-01-02 Thread Iceberg
Hi there, I noticed there are discussions about "Helper for Custom Forms", such as: http://groups.google.com/group/web2py/browse_thread/thread/2d8cc57352d158bd?hl=en However, I am trying to do the same thing in a different approach. Not sure whether my approach is better, so I post the

[web2py:14430] Re: gae - specifying choices to StringProperty

2009-01-02 Thread Robin B
You are right, the driver does not use ReferenceProperty, but uses IntegerProperty for all references. ReferenceProperty is a convenience for the AppEngine ORM and is not needed in web2py DAL, and would be incompatible with the SQL tables. Originally, gql.py generated GQL and passed it to GQLQue

[web2py:14429] Re: Delete from admin/design broken in trunk

2009-01-02 Thread mr.freeze
It looks like they changed the cgi module in 2.6 to pull the query string for both GET and POST when using FieldStorage. Do you try to maintain 2.6 compatibility or should I revert to 2.5? Supporting articles: http://bugs.python.org/issue1817 http://trac.edgewall.org/ticket/7876 On Jan 1, 1:37

[web2py:/] Re: t2 looking for files in the wrong directory on GAE

2009-01-02 Thread mdipierro
I will look into this but I cannot reproduce your problem. I do not see how the wrong url can be generated. I believe that file is part of fancyzoom. Do you have an old version of plugin_t2? I reposted the latest version in case I made a mistake in the past. Massimo On Jan 2, 11:06 am, "Miguel

[web2py:14427] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread mdipierro
> are we just stuck with specifying/not specifiying [...] for 'requires'? yes. I agree there are alternatives but they would break backward compatibility. You can override this behavior using db.table.field.widget=your_own_widget. web2py 1.55 for example allows things like db.table.string_fi

[web2py:14426] Re: gae - specifying choices to StringProperty

2009-01-02 Thread sudhakar m
Thanks Robin for a detailed explanation on HABTM vs ListProperty. db.define_table("Match", > SQLField("ground", "string"), > SQLField("result", "string")) > > db.define_table("Team", > SQLField("name", "string")) > > db.define_table("Player", > SQLField("name", "string")) > >

[web2py:14425] Re: t2 looking for files in the wrong directory on GAE

2009-01-02 Thread Miguel Goncalves
oops sent to fast... :) CRbox/ app.yaml Applications/ admin welcome plugin_t2 the content of my app.yaml is: application: web2py version: 1 api_version: 1 runtime: python handlers: - url: /(?P.+?)/static/(?P.+) static_files: applications/\1/static/\2 upload: applicat

[web2py:14424] Re: t2 looking for files in the wrong directory on GAE

2009-01-02 Thread Miguel Goncalves
hi Massimo, No I do not have an application called "plugin". My directory structure is: CARbox/ Applications/ On Fri, Jan 2, 2009 at 12:35 AM, mdipierro wrote: > > I cannot figure out where that links is built in T2. > Do you have an app called plugins? > > Massimo > > On Jan 2, 2:13 am, Migu

[web2py:14423] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread rctay
On Jan 3, 12:07 am, mdipierro wrote: > On Jan 2, 9:57 am, rctay wrote: > > > On Jan 2, 11:26 pm, mdipierro wrote: > > > > This is a good point but the fact is that > > > >     db.table.field.requires=[IS_IN_SET(['a','b','c'])] > > > > is different from > > > >     db.table.field.requires=IS_I

[web2py:14422] Re: gae - specifying choices to StringProperty

2009-01-02 Thread Robin B
Here is some additional info about ListProperty vs HABTM. The same schema adding Membership tables instead of ListProperties: db.define_table("Match", SQLField("ground", "string"), SQLField("result", "string")) db.define_table("Team", SQLField("name", "string")) db.define_tab

[web2py:14421] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread mdipierro
On Jan 2, 9:57 am, rctay wrote: > On Jan 2, 11:26 pm, mdipierro wrote: > > > This is a good point but the fact is that > > > db.table.field.requires=[IS_IN_SET(['a','b','c'])] > > > is different from > > > db.table.field.requires=IS_IN_SET(['a','b','c']) > > > Both validate the input i

[web2py:14420] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread rctay
On Jan 2, 11:26 pm, mdipierro wrote: > This is a good point but the fact is that > >     db.table.field.requires=[IS_IN_SET(['a','b','c'])] > > is different from > >     db.table.field.requires=IS_IN_SET(['a','b','c']) > > Both validate the input in the same way but the latter also make a > sel

[web2py:14419] Re: gae - specifying choices to StringProperty

2009-01-02 Thread sudhakar m
Yep got the source from http://mdp.cti.depaul.edu/examples/static/1.55rc2/web2py_src.zip I will do some trials and post back. Sudhakar.M --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.

[web2py:14418] T2/T3 cheatsheet

2009-01-02 Thread Massimo Di Pierro
http://www.reddit.com/r/programming/comments/7myrp/web2py_t3_cheatsheet/ thanks Paul. Let's all vote it up! Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this gro

[web2py:14417] Re: gae - specifying choices to StringProperty

2009-01-02 Thread mdipierro
the folder is called rc2. Actually it contains rc4 now. Sorry for the confusion. Massimo On Jan 2, 9:42 am, "sudhakar m" wrote: > > Assuming one player playes only for one team you can store the team with > > the player in the Player table not use a many2many between team and player. > > In my

[web2py:14416] Re: gae - specifying choices to StringProperty

2009-01-02 Thread sudhakar m
> Assuming one player playes only for one team you can store the team with > the player in the Player table not use a many2many between team and player. In my case player plays for more than one team. > > . The problem is GAE does not allow retrieving more than 1000 records at > the time. I am

[web2py:14415] Re: Upper and lower case problems with sqllite, Greek / German and itemize / select

2009-01-02 Thread mdipierro
I do not know. The same version that comes with python 2.5. Massimo On Jan 2, 9:35 am, Petros Diveris wrote: > Hi > > Thanks for the quick reply. I was rather surprised to read on the > supplied link, I always assumed that sqlite would handle utf-8 upper / > lower case. What version is the sqli

[web2py:14414] Re: Upper and lower case problems with sqllite, Greek / German and itemize / select

2009-01-02 Thread Petros Diveris
Hi Thanks for the quick reply. I was rather surprised to read on the supplied link, I always assumed that sqlite would handle utf-8 upper / lower case. What version is the sqlite bundled with web2py 1.54 windows? Cheers Petros Diveris On Jan 2, 1:27 pm, mdipierro wrote: > This > > http://www.

[web2py:14413] Re: db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread mdipierro
This is a good point but the fact is that db.table.field.requires=[IS_IN_SET(['a','b','c'])] is different from db.table.field.requires=IS_IN_SET(['a','b','c']) Both validate the input in the same way but the latter also make a select/option dropbox. Moreover doing db.table.field.r

[web2py:14412] db.field.requires enforced as a list (or iterable)?

2009-01-02 Thread rctay
Hi, (this is somewhat related to my post http://groups.google.com/group/web2py/browse_thread/thread/fa10eaed0565262b) i noticed that there is a somewhat inconsistent usage of the 'requires' attribute as a list sometimes and a scalar at others. for example, in the SQLFORM __init__ treats the fie

[web2py:14411] Re: gae - specifying choices to StringProperty

2009-01-02 Thread mdipierro
I do not know. but the slowdown is not storing and retrieving the list. the slowdown will be in populating the dropbox. Even wrose. The problem is GAE does not allow retrieving more than 1000 records at the time. This means that if you have more than 1000 players and/or teams you are in trouble.

[web2py:14410] Re: gae - specifying choices to StringProperty

2009-01-02 Thread sudhakar m
Thanks Massimo. > > db.define_table("Player", > SQLField("name", "string")) > > db.define_table("Team", > SQLField("name", "string"), > SQLField("player_ids", "text")) > > db.define_table("Match", > SQLField("ground", "string"), > SQLField("result", "string"), > S

[web2py:14409] Re: t2.create error

2009-01-02 Thread mdipierro
just fixed in trunk. Please give it a try as well. Thanks for reporting this. Massimo On Jan 2, 8:50 am, notabene wrote: > That's it. > Added cache to list in line 405. > Thank You! > > On 2 Jan., 15:44, mdipierro wrote: > > > If running on source edit File "/home/hosts/googleappengine/web2py/

[web2py:14408] Re: t2.create error

2009-01-02 Thread notabene
That's it. Added cache to list in line 405. Thank You! On 2 Jan., 15:44, mdipierro wrote: > If running on source edit File "/home/hosts/googleappengine/web2py/ > gluon/contrib/gql.py", line 407 and add 'cache' to the list. > This will be fixed in the next version. This is only a problem with >

[web2py:14406] Re: t2.create error

2009-01-02 Thread mdipierro
If running on source edit File "/home/hosts/googleappengine/web2py/ gluon/contrib/gql.py", line 407 and add 'cache' to the list. This will be fixed in the next version. This is only a problem with trunk not with the stable version. On Jan 2, 8:41 am, mdipierro wrote: > which version? 1.55 or ear

[web2py:14407] Re: t2.create error

2009-01-02 Thread notabene
Version 1.55rc3 On 2 Jan., 15:41, mdipierro wrote: > which version? 1.55 or earlier? > > Massimo > > On Jan 2, 8:20 am, notabene wrote: > > > Can anyone help with this t2.create() error? > > > "invalid select attribute" > > Works in web2py  - fails in gae (dev_appserver) > > I did not define a

[web2py:14405] Re: t2.create error

2009-01-02 Thread mdipierro
which version? 1.55 or earlier? Massimo On Jan 2, 8:20 am, notabene wrote: > Can anyone help with this t2.create() error? > > "invalid select attribute" > Works in web2py - fails in gae (dev_appserver) > I did not define an (options) widget. > > ERROR2009-01-02 13:44:41,426 main.py] Traceb

[web2py:14404] Re: gae - specifying choices to StringProperty

2009-01-02 Thread mdipierro
Oliver, mind that JOINs do not work on GAE. Even if portability is not an issue for you, it is for web2py. This means web2py does not upport APIs that work on GAE but not otherwise. You can mimic the GAE list property in a portable way using: db.define_table("Player", SQLField("name", "st

[web2py:14403] t2.create error

2009-01-02 Thread notabene
Can anyone help with this t2.create() error? "invalid select attribute" Works in web2py - fails in gae (dev_appserver) I did not define an (options) widget. ERROR2009-01-02 13:44:41,426 main.py] Traceback (most recent call last): File "/home/nb/web2py/gluon/restricted.py", line 62, in res

[web2py:/] Re: gae - specifying choices to StringProperty

2009-01-02 Thread sudhakar m
Hi Robin, Thanks for the explanation. But I still couldnt quite get it right. This is what I have. For example in case of cricket match, 1. Each match has many teams(say 2) 2. Each team has many players 3. Each Player belongs to many teams So we have many-to-many relationship between m

[web2py:14401] Re: Upper and lower case problems with sqllite, Greek / German and itemize / select

2009-01-02 Thread mdipierro
This http://www.sqlite.org/lang_expr.html says: "A bug: SQLite only understands upper/lower case for 7-bit Latin characters. Hence the LIKE operator is case sensitive for 8-bit iso8859 characters or UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE."

[web2py:14400] Upper and lower case problems with sqllite, Greek / German and itemize / select

2009-01-02 Thread Petros Diveris
Hi everyone and happy neww year! I have come across a very strange problem where I am trying to select from an sqlite table with db.babel.definition.upper().like("'%"+me.word.upper()+"%'") ) which yields nothing. The same happens if I try using sqlite's upper function db.babel.definition.upper

[web2py:14399] future of T2/T3

2009-01-02 Thread Massimo Di Pierro
We need to have a brainstorming session on the future of T2/T3. Let's use http://www.web2pychat.com/ I can do Monday January 12 at 1pm Central Time. If you are interested, please email me privately about the proposed schedule. Massimo --~--~-~--~~~---~--~~ You rec

[web2py:14398]

2009-01-02 Thread Massimo Di Pierro
We need to have a brainstorming session on the future of T2/T3. Let's use http://www.web2pychat.com/ I can do Monday January 12 at 1pm Central Time. If you are interested, please email me privately about the proposed schedule. Massimo --~--~-~--~~~---~--~~ You r

[web2py:14397] Re: open source organization again

2009-01-02 Thread mdipierro
This is a good point but not something we really need to worry at the beginning. About 100 people on this list have contributed to web2py with comments, questions, patches. The association should recognize this. Once we form a core we may have a period when people sign up and take online tests and

[web2py:14396] Re: nicedit

2009-01-02 Thread mdipierro
If you have html in in a record.body you should display it with {{=XML(record.body)}} or better, to avoid XSS Injections {{=XML(record.body,sanitize=True)}} You can also specify which tags are allowed and which attributes {{=XML(record.body,sanitize=True, permittied_tags= ['a'],al

[web2py:14395] nicedit

2009-01-02 Thread annet
I built a simple mock app to explore nicedit. As a model I defined a table: db.define_table('mock', SQLField('body', 'text'), migrate='mock.table') In the view I manage to insert a text into the mock table, and to prepopulate the text area with the inserted text, so the user can update the text

[web2py:14394] Re: 1.55rc2 and Happy New Year.

2009-01-02 Thread mdipierro
there is a README file although it is not very accurate. Massimo On Jan 2, 3:00 am, annet wrote: > Massimo, > > Happy new year to you too. > > Getting started with web2py was the best thing that happened to me in > 2008, compared to JSP/Servlets, ASP/VBScript and PHP, web2py works > like a drea

[web2py:14393] Re: 1.55rc2 and Happy New Year.

2009-01-02 Thread annet
Massimo, Happy new year to you too. Getting started with web2py was the best thing that happened to me in 2008, compared to JSP/Servlets, ASP/VBScript and PHP, web2py works like a dream. I went through the new features of 1.55rc2 and wondered whether there is an overview of features added to pr

[web2py:14392] Re: t2 looking for files in the wrong directory on GAE

2009-01-02 Thread mdipierro
I cannot figure out where that links is built in T2. Do you have an app called plugins? Massimo On Jan 2, 2:13 am, Miguel wrote: > Hi > > I am using T2 on GAE (dev_appserver for now) and have the following > error: > > [Errno 2] No such file or directory: 'G:\\google_appengine\\CRBox\ > \applic

[web2py:14391] t2 looking for files in the wrong directory on GAE

2009-01-02 Thread Miguel
Hi I am using T2 on GAE (dev_appserver for now) and have the following error: [Errno 2] No such file or directory: 'G:\\google_appengine\\CRBox\ \applications/plugins/static/t2/media/tl.png' So the server cannot find the file tl.png in the specified path. This is not surprising since the file r

[web2py:14390] Re: Proposal: MVC separation - son of custom views

2009-01-02 Thread Yarko Tymciurak
Hi Bill - Sorry - I was sort of in shock when read my own comments (remind me not to right when I'm tired!) - but I am glad you could understand them. On Fri, Jan 2, 2009 at 1:32 AM, billf wrote: > > Yarko > > I finally got around to looking at your comments in detail with the > following result