Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Michele Comitini
should we have a stable and beta (latest) release?  Many people do not
use trunk, because changes too fast I guess.
Having a beta period before stable could help attract more beta
testers, but I think it would add a burden for version control...

mic


2010/12/22 ron_m ron.mco...@gmail.com:
 If you are sensitive to new releases to production then take a slower
 approach. 1.90.1 to 1.90.6 happened in just over a day with very big changes
 coming into 1.90.1 to make the future development in certain directions
 possible. I think there were more problems found in trunk testing before
 release than after. I helped test trunk but once everything was fixed for my
 use of the application server I could no longer add any value since it all
 worked for me for at least a week before the public release came out. If
 production was on 1.89.5 and a one week wait were used post next release
 which I would consider aggressive upgrading to production then 1.91.1 would
 be where you are today which is mostly license comments compared to 1.90.6.

 I am still developing the application I am working on so I follow the
 releases quickly there to get some testing in but I have some beta
 production systems up and haven't touched them in several weeks. I guess
 they call that staging. I also hang onto a copy of the old release until I
 am sure the next is good so it can be swapped back quickly.



[web2py] Re: Left Join with aliased table and the new DAL

2010-12-22 Thread HaM
Ok in order to simplify the problem I have changed my code to this:
Domain = db.domain
Client = db.client
Manager = db.contact.with_alias('manager')

sql = db((Domain.id==1)(Client.id==Domain.client_id))._select(
Domain.name, Client.name, Manager.name,
left=[Manager.on(Manager.id==Client.manager_id)])
print sql

The result is:
SELECT  domain.name, client.name, contact.name FROM domain, client,
contact LEFT JOIN contact AS manager ON (contact.id =
client.manager_id) WHERE ((domain.id = 1) AND (client.id =
domain.client_id));

And this request is not correct for PostgreSQL. I think that it should
be :
SELECT  domain.name, client.name, manager.name FROM domain, client
LEFT JOIN contact as manager ON (manager.id = client.manager_id) WHERE
((domain.id = 1) AND (client.id = domain.client_id));

Which works well.

In order to push research further I also tried to do only INNER JOIN
with an aliased table and it partially works:
Domain = db.domain
Client = db.client
Manager = db.contact.with_alias('manager')
sql = db((Domain.id==1)
(Client.id==Domain.client_id)
(Manager.id==Client.manager_id))._select(
Domain.name, Client.name, Manager.name)
print sql

Result:
SELECT  domain.name, client.name, contact.name FROM domain, client,
contact WHERE (((domain.id = 1) AND (client.id = domain.client_id))
AND (contact.id = client.manager_id));

It works but it doesn't use the alias name for the table contact. Thus
the resulting dict() doesn't contains the key manager but the key
contact.

Thank you for investigating this problem so quickly.

On Dec 21, 10:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 hmm...

 I am trying your select and it now generates the same sql as the old
 dal. please try this:

 Domain = db.domain
 Client = db.client
 Manager = db.contact.with_alias('manager')
 sql = db(Domain.id==1)._select(
     Domain.ALL, Client.ALL,Manager.ALL,
     left=[Client.on(Client.id==Domain.client_id),
           Manager.on(Manager.id==Client.manager_id)])
 print sql

 what do you get?
 I get

 SELECT  domain.id, domain.name, domain.client_id, client.id,
 client.name, client.manager_id, manager.id, manager.name FROM domain
 LEFT JOIN client ON (client.id = domain.client_id) LEFT JOIN contact
 AS manager ON (manager.id = client.manager_id) WHERE (domain.id = 1);

 On Dec 21, 2:55 pm, HaM yarib...@gmail.com wrote:

  I just tried with the last revision (1414:da25156addab) and the
  problem stills the same.




[web2py] Members database

2010-12-22 Thread Kenneth Lundström

Hello,

a small design question.

I´m planing a intranet which contains a members database. Their postal 
address and some other info.


Would you use the auth_user table to store all members or make a 
different table for it.


- If I use auth_user what to do with members not intresered in login?

- If I choose to make a different table, some of the members will be 
using the intranet so they their e-mailaddress would be in two places



Kenneth



[web2py] Apache quits Java governance group in protest of Oracle abuses

2010-12-22 Thread Michele

Just to keep u update on the Oracle takeover

Sent to you by Michele via Google Reader: Apache quits Java governance
group in protest of Oracle abuses via Open Ended by
segpha...@arstechnica.com (Ryan Paul) on 12/9/10

The Apache Software Foundation (ASF) announced today that it is
resigning from the executive committee of the Java Community Process
(JCP), the governance body responsible for managing standards related
to the Java programming language. The move is a response to Oracle's
ongoing failure to comply with the intellectual property policies
established by the JCP.

The heart of the issue is that Apache can't certify that its open
source Java implementation—called Harmony—conforms with the Java
language standards because Oracle refuses to supply the necessary test
suites under a suitably open license. Oracle's position on the issue
falls afoul of JCP policies, which stipulate that standards and other
relevant materials must be freely redistributable and made available
under terms that are conducive to enabling third-party open source
implementations.



Read the comments on this post



Things you can do from here:
- Subscribe to Open Ended using Google Reader
- Get started using Google Reader to easily keep up with all your
favorite sites


[web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread Johann Spies
I work with tables of hundreds of thousands of records.  Although jqgrid
seems faster than the other grids mentioned in the Subject-line it still
works too long when a large table is selected.  All the abovementioned grids
have their own pagination but it seems that they do not use that while
querying the database. The result is that it uses large chunks of RAM.

Now my question: is it possible to combine the easy pagination options
available in the abovementioned grids with smaller queries to the backend or
is the only option for me to use my own pagination (like the example in the
book) in combination with SQLTABLE?


Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: It is done GPL2 - LGPL3

2010-12-22 Thread vihang
+3 LGPL ! Will make web2py more acceptable... !

On Dec 22, 7:38 am, Luis Díaz diazluis2...@gmail.com wrote:
 +1

 2010/12/22 R. Strusberg strusb...@gmail.com

  Another reason to switch from *webframework to web2py!.

  +1 :-) Merry Christmas +1

  2010/12/21 mdipierro mdipie...@cs.depaul.edu:
   For now trunk only. This will propagate to stable since 1.91.1

 --
 Díaz Luis
 TSU Analisis de Sistemas
 Universidad de Carabobo

 http://web2pyfacil.blogspot.com/
 Facultad de 
 Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 9:17 AM, Michele Comitini
michele.comit...@gmail.com wrote:
 should we have a stable and beta (latest) release?  Many people do not
 use trunk, because changes too fast I guess.
 Having a beta period before stable could help attract more beta
 testers, but I think it would add a burden for version control...

Why not just label new releases as edge or something, and leave a
copy of an old release labeled stable? That way, release model is
unchanged, but people do get some idea about the expected stability.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread rochacbruno
I am working on server side pagination/sorting/search for powerTable. 

Hope to finish soon. 

Enviado via iPhone

Em 22/12/2010, às 08:24, Johann Spies johann.sp...@gmail.com escreveu:

 I work with tables of hundreds of thousands of records.  Although jqgrid 
 seems faster than the other grids mentioned in the Subject-line it still 
 works too long when a large table is selected.  All the abovementioned grids 
 have their own pagination but it seems that they do not use that while 
 querying the database. The result is that it uses large chunks of RAM. 
 
 Now my question: is it possible to combine the easy pagination options 
 available in the abovementioned grids with smaller queries to the backend or 
 is the only option for me to use my own pagination (like the example in the 
 book) in combination with SQLTABLE?
 
 
 Regards
 Johann
 
 -- 
  May grace and peace be yours in abundance through the full knowledge of God 
 and of Jesus our Lord!  His divine power has given us everything we need for 
 life and godliness through the full knowledge of the one who called us by his 
 own glory and excellence. 
 2 Pet. 1:2b,3a
 


Re: [web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread Johann Spies
On 22 December 2010 14:01, rochacbruno rochacbr...@gmail.com wrote:

 I am working on server side pagination/sorting/search for powerTable.

 Hope to finish soon.


Thanks.

I have since my previous email discovered that switching from the rocket
server to apache makes a huge difference in speed and memory usage.

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


Re: [web2py] Apache quits Java governance group in protest of Oracle abuses

2010-12-22 Thread Branko Vukelić
We all saw it coming. :)

On Wed, Dec 22, 2010 at 10:45 AM, Michele michele.comit...@gmail.com wrote:

 Just to keep u update on the Oracle takeover




 Sent to you by Michele via Google Reader:




 Apache quits Java governance group in protest of Oracle abuses

 via Open Ended by segpha...@arstechnica.com (Ryan Paul) on 12/9/10

 The Apache Software Foundation (ASF) announced today that it is resigning 
 from the executive committee of the Java Community Process (JCP), the 
 governance body responsible for managing standards related to the Java 
 programming language. The move is a response to Oracle's ongoing failure to 
 comply with the intellectual property policies established by the JCP.

 The heart of the issue is that Apache can't certify that its open source Java 
 implementation—called Harmony—conforms with the Java language standards 
 because Oracle refuses to supply the necessary test suites under a suitably 
 open license. Oracle's position on the issue falls afoul of JCP policies, 
 which stipulate that standards and other relevant materials must be freely 
 redistributable and made available under terms that are conducive to enabling 
 third-party open source implementations.

 Read the comments on this post




 Things you can do from here:

 Subscribe to Open Ended using Google Reader
 Get started using Google Reader to easily keep up with all your favorite sites





--
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] web2py 1.91.1 is OUT (LGPLv3)

2010-12-22 Thread Tom Atkins
I hereby nominate web2py for 'Fastest developing full-stack web framework of
the year award'.

It's amazing how much has been added and fixed in 12 months since I've been
using web2py.  Well done Massimo and everyone.  Looking forward to 2011!


Re: [web2py] web2py 1.91.1 is OUT (LGPLv3)

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 1:49 PM, Tom Atkins minkto...@gmail.com wrote:
 It's amazing how much has been added and fixed in 12 months since I've been

Are you kidding? Only the last two MONTHS were insane! :D

= Massimo Quick-Fingers DiPierro, the sheriff of Web2pyville.



-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] The stability of web2py releases

2010-12-22 Thread appydev
Regards,

Sometimes I notice that when an error is
detected in the stable,this is fixed in the trunk. On the
other hand, all the new featuresare included in the
trunk. New features bring new bugs, thus thetrunk will always have some
errors that are passed to the stable.

I think there should be a version, not to call it ... ,
Something likeUbuntu LTS (Long Term Support). and that
this version receiveimmediate bug fixes. and other critical updates that do
notprovide new features mean, for a considerable time until thestable
version and has been sufficiently tested.


2010/12/21 Luther Goh Lu Feng elf...@yahoo.com

 I have started using web2py a few months ago and I have noticed that
 some of the releases might actually be far from stable. Take for
 instance, the 1.90 release. There were unfortunately quite a few
 uncaught bugs and this was followed by a flurry of bug fix releases. I
 understand that this is because there are not enough people testing
 trunk.

 Given that web2py is supposed to be an enterprise web framework, I
 wonder if it will be better if stable release versions are identified,
 so that existing users of web2py can do upgrades without having
 serious worries about breakage. Or are there some existing practices
 that existing web2py users have to address such issues?


Re: [web2py] The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 3:44 PM, appydev appy...@gmail.com wrote:
 I think there should be a version, not to call it ... ,
 Something likeUbuntu LTS (Long Term Support). and that
 this version receiveimmediate bug fixes. and other critical updates that do
 notprovide new features mean, for a considerable time until thestable
 version and has been sufficiently tested.

LTS is a completely different ting. It means a lot of backporting of
stuff that's fixed in later releases, and keeping it supported for 3
years. I don't think any framework does it. It's sufficient that we
have a stable and unstable (or edge, or whatever) versions. The latter
would be a _released_ version, but is not considered thoroughly
tested. It's like Debian's unstable-testing-stable cycle.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: The stability of web2py releases

2010-12-22 Thread KR
I support that.
For me the last stable is 1.89.5 (or maybe 1.90.6 ? if the new DAL is
stable)
The only missing stuff is a place to download it.

On 22 déc, 15:49, Branko Vukelić stu...@brankovukelic.com wrote:
 On Wed, Dec 22, 2010 at 3:44 PM, appydev appy...@gmail.com wrote:
  I think there should be a version, not to call it ... ,
  Something likeUbuntu LTS (Long Term Support). and that
  this version receiveimmediate bug fixes. and other critical updates that do
  notprovide new features mean, for a considerable time until thestable
  version and has been sufficiently tested.

 LTS is a completely different ting. It means a lot of backporting of
 stuff that's fixed in later releases, and keeping it supported for 3
 years. I don't think any framework does it. It's sufficient that we
 have a stable and unstable (or edge, or whatever) versions. The latter
 would be a _released_ version, but is not considered thoroughly
 tested. It's like Debian's unstable-testing-stable cycle.

 --
 Branko Vukelic

 stu...@brankovukelic.comhttp://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Luis Díaz
in particular whenever new versions come out ... I always say ... have to wait
1 week or 2 to becomestable ...

unless the new features are highly anticipated and then one is
dedicated to testing
the system


2010/12/22 KR kaerbu...@gmail.com

 I support that.
 For me the last stable is 1.89.5 (or maybe 1.90.6 ? if the new DAL is
 stable)
 The only missing stuff is a place to download it.

 On 22 déc, 15:49, Branko Vukelić stu...@brankovukelic.com wrote:
  On Wed, Dec 22, 2010 at 3:44 PM, appydev appy...@gmail.com wrote:
   I think there should be a version, not to call it ... ,
   Something likeUbuntu LTS (Long Term Support). and that
   this version receiveimmediate bug fixes. and other critical
 updates that do
   notprovide new features mean, for a considerable time until thestable
   version and has been sufficiently tested.
 
  LTS is a completely different ting. It means a lot of backporting of
  stuff that's fixed in later releases, and keeping it supported for 3
  years. I don't think any framework does it. It's sufficient that we
  have a stable and unstable (or edge, or whatever) versions. The latter
  would be a _released_ version, but is not considered thoroughly
  tested. It's like Debian's unstable-testing-stable cycle.
 
  --
  Branko Vukelic
 
  stu...@brankovukelic.comhttp://www.brankovukelic.com/




-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

http://web2pyfacil.blogspot.com/
Facultad de 
Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85


Re: [web2py] The stability of web2py releases

2010-12-22 Thread appydev
I have not talked for 3 years. not, I did not say which should be LTS.
I said that there should be a stable release, and is receiving immediate bug
fixes. and other critical updates that do not provide new features mean, for
a considerable time until the new features are sufficiently tested. but did
not know how to call because there is already a stable version.

Let me make clear that what I propose, is one of stability, no way I'd like
to see decrease the wonderful pace with evolving web2py.

2010/12/22 Branko Vukelić stu...@brankovukelic.com

 On Wed, Dec 22, 2010 at 3:44 PM, appydev appy...@gmail.com wrote:
  I think there should be a version, not to call it ... ,
  Something likeUbuntu LTS (Long Term Support). and that
  this version receiveimmediate bug fixes. and other critical
 updates that do
  notprovide new features mean, for a considerable time until thestable
  version and has been sufficiently tested.

 LTS is a completely different ting. It means a lot of backporting of
 stuff that's fixed in later releases, and keeping it supported for 3
 years. I don't think any framework does it. It's sufficient that we
 have a stable and unstable (or edge, or whatever) versions. The latter
 would be a _released_ version, but is not considered thoroughly
 tested. It's like Debian's unstable-testing-stable cycle.


 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] web2py 1.91.1 is OUT (LGPLv3)

2010-12-22 Thread Richard Vézina
I have been hacking a bit with Django yesterday and realize how much simpler
web2py is... I Like w2p so much...

Thanks to Massimo and all the core dev team that improve web2py every day.

Happy holidays to all

Richard





2010/12/22 Branko Vukelić stu...@brankovukelic.com

 On Wed, Dec 22, 2010 at 1:49 PM, Tom Atkins minkto...@gmail.com wrote:
  It's amazing how much has been added and fixed in 12 months since I've
 been

 Are you kidding? Only the last two MONTHS were insane! :D

 = Massimo Quick-Fingers DiPierro, the sheriff of Web2pyville.



 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] web2py 1.91.1 is OUT (LGPLv3)

2010-12-22 Thread R. Strusberg
+1

2010/12/22 Tom Atkins minkto...@gmail.com:
 I hereby nominate web2py for 'Fastest developing full-stack web framework of
 the year award'.
 It's amazing how much has been added and fixed in 12 months since I've been
 using web2py.  Well done Massimo and everyone.  Looking forward to 2011!


[web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread dcrodjer
Hi,
I just *updated my web2py* version to *1.91.1* but after the update I am 
unable to deploy my applications on *GAE*. The apps run on the local app 
engine skd with no errors. I even tried downloading a fresh source and 
deploying it but no effect

I stll get an Internal server error and these are the details of the error 
from the admin log: 

type 'exceptions.AttributeError': 'module' object has no attribute 'mkdir'
Traceback (most recent call last):
File 
/base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gaehandler.py, 
line 58, in module
import gluon.main
File 
/base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gluon/main.py, 
line 52, in module
create_missing_folders()
File 
/base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gluon/admin.py, 
line 449, in create_missing_folders
os.mkdir(path)


From this it seems that web2py is trying to make directories in the gae 
sandbox. I have tried removing all skipped files but still no avail. I have 
also tried deploying from the admin site ( But I don't think that would 
matter).

Can someone please tell me what I am doing wrong or is there something that 
is needed to be done and I am unaware of?


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
2010/12/22 Luis Díaz diazluis2...@gmail.com:

 in particular whenever new versions come out ... I always say ... have
 to wait 1 week or 2 to becomestable ...

Not become stable, but be proven stable. You release, wait for
everyone to give it a go. If everyone is happy, then it's considered
stable, and move to stable box on the downloads page. If someone
complains, it stays in unstable indefinitely, and a new release is
made fixing the bugs.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] web2py 1.91.1 is OUT (LGPLv3)

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 4:19 PM, Richard Vézina
ml.richard.vez...@gmail.com wrote:
 I have been hacking a bit with Django yesterday and realize how much simpler

Django is a humongous monster (call it feature-rich, I call it bloat).
You really have to spend a lot of time before you can do anything with
it. And even then, parts of Django will fight you (like content types
framework) until you go mad, or submit to its weird ways.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread Bruno Rocha
May be this line :
if not request.env.web2py_runtime_gae:

is missing in referred method.

Can you try to change the method for test?

IN main.py line 445

def create_missing_folders():
for path in ('applications', 'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages', gluon=
True), )
[add_path_first(path) for path in paths]

should be:

def create_missing_folders():
if not request.env.web2py_runtime_gae: for path in ('applications',
'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages', gluon=
True), )
[add_path_first(path) for path in paths]


I don't know if this is really a solution, but worth a try.

I'll make some tests here too.

Bruno.

2010/12/22 dcrodjer rohanjain@gmail.com

 Hi,
 I just *updated my web2py* version to *1.91.1* but after the update I am
 unable to deploy my applications on *GAE*. The apps run on the local app
 engine skd with no errors. I even tried downloading a fresh source and
 deploying it but no effect

 I stll get an Internal server error and these are the details of the error
 from the admin log:

 type 'exceptions.AttributeError': 'module' object has no attribute
 'mkdir'
 Traceback (most recent call last):
 File
 /base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gaehandler.py,
 line 58, in module
 import gluon.main
 File
 /base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gluon/main.py,
 line 52, in module
 create_missing_folders()
 File
 /base/data/home/apps/dcrodjer-web2py/1.347093779494156164/gluon/admin.py,
 line 449, in create_missing_folders
 os.mkdir(path)


 From this it seems that web2py is trying to make directories in the gae
 sandbox. I have tried removing all skipped files but still no avail. I have
 also tried deploying from the admin site ( But I don't think that would
 matter).

 Can someone please tell me what I am doing wrong or is there something that
 is needed to be done and I am unaware of?




-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Thadeus Burgess
Funny,

Every three to four weeks this topic of discussion comes up.

Lots of the same ideas are said over and over again.

Nobody has time to work on certain things like this since most of us have
full time jobs that may or may not be related to web2py.

What I do is if my app works with a certain version, I don't ever upgrade
the web2py unless I need a brand new feature or bugfix that effects me. This
has been my adaptation to the fast development cycle.

Think of web2py as the gentoo of python web frameworks... its *very* fast
and efficient and you get lots of new stuff often, but expect updates to
break.

--
Thadeus




2010/12/22 Branko Vukelić stu...@brankovukelic.com

 2010/12/22 Luis Díaz diazluis2...@gmail.com:
 
  in particular whenever new versions come out ... I always say ... have
  to wait 1 week or 2 to becomestable ...

 Not become stable, but be proven stable. You release, wait for
 everyone to give it a go. If everyone is happy, then it's considered
 stable, and move to stable box on the downloads page. If someone
 complains, it stays in unstable indefinitely, and a new release is
 made fixing the bugs.


 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 5:05 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 Nobody has time to work on certain things like this since most of us have
 full time jobs that may or may not be related to web2py.

What do you mean? No time to develop a system of labeling releases or
no time to upgrade, test, etc?

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


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

2010-12-22 Thread Carlos
Thank you all for your replies !

On Dec 20, 10:21 pm, Plumo richar...@gmail.com wrote:
 Or you could use this service and cache the 
 values:http://www.geobytes.com/IpLocator.htm?GetLocationtemplate=json.txti...


Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 7:55 AM, Bruno Rocha wrote:
 May be this line :
 if not request.env.web2py_runtime_gae:
 
 
 is missing in referred method.
 
 
 Can you try to change the method for test?
 
 
 IN main.py line 445
 
 
 
 def create_missing_folders():
 for path in ('applications', 'deposit', 'site-packages', 'logs'):
 path = abspath(path, gluon=True)
 if not os.path.exists(path):
 os.mkdir(path)
 paths = (global_settings.gluon_parent, abspath('site-packages', 
 gluon=True), )
 [add_path_first(path) for path in paths]
 
 
 should be:
 
 
 def create_missing_folders():
 if not request.env.web2py_runtime_gae
 :
 for path in ('applications', 'deposit', 'site-packages', 'logs'):
 path = abspath(path, gluon=True)
 if not os.path.exists(path):
 os.mkdir(path)
 paths = (global_settings.gluon_parent, abspath('site-packages', 
 gluon=True), )
 [add_path_first(path) for path in paths]
 
 I don't know if this is really a solution, but worth a try.
 
 I'll make some tests here too.
 
 

I think that's right, Bruno. The missing-folder logic got factored out, because 
it wasn't being invoked for any server except Rocket, but it shouldn't run for 
GAE. However, we still want the sys.path logic, so the fix should look more 
like this:

def create_missing_folders():
if not request.env.web2py_runtime_gae:
for path in ('applications', 'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages', 
gluon=True), )
[add_path_first(path) for path in paths]





Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread dcrodjer
@Bruno, Thanks for the prompt reply

I found the function you specified in admin.py, following the error. 

This won't work, the function needs the *request* var. So 

if not request.env.web2py_runtime_gae:

can't be put there. Also I tried putting passing *request* as argument in  *
create_missing_folders()* main.py where it is being called. 

So what I did currently is comment out the call to this function in main.py. 
But this doesn't seems like the right solution. 

 



[web2py] Link to mod_wsgi.so download for py25 not working

2010-12-22 Thread Rupesh Pradhan
The following link from the web2py online book is not working.

http://adal.chiriliuc.com/mod_wsgi/revision_1018_2.3/mod_wsgi_py25_apache22/mod_wsgi.so

Any alternate URL?

Rupesh


[web2py] Re: default values in options widget

2010-12-22 Thread Oleg
As far as I understood, the problem is that, it is not possible (??) in 
current web2py crud implementation to map one label in dropdown control to 
database NULL value.
If you do IS_IN_SET({None:'Unknown','Opt1':'Opt1', 'Opt2':'Opt2'}, 
zero=None) and submit the 'Unknown', you become 'None' as string in DB, but 
not NULL.. and in other direction there is the same problem. NULL value in 
DB will not initialize 'Unknown' value in dropdown control  


Re: [web2py] The stability of web2py releases

2010-12-22 Thread Anthony
On Wednesday, December 22, 2010 9:44:27 AM UTC-5, appydev wrote: 

 Regards,

 Sometimes I notice that when an error is 
 detected in the stable,this is fixed in the trunk. On the 
 other hand, all the new featuresare included in the 
 trunk. New features bring new bugs, thus thetrunk will always have some 
 errors that are passed to the stable.

 
But usually after a .1 release (e.g., 1.90.1), the next few releases come in 
rapid succession and solely fix bugs, so within a week or so, we end up with 
a fairly stable .3 or .4 -- new features (and new bugs) aren't typically 
added until the next .1 release. It probably makes sense to think of most .1 
releases more like release candidates.
 
Anthony


[web2py] Re: How to do this in web2py..?

2010-12-22 Thread Carlos
Hi,

Maybe the following can help (with respect to one common form from
multiple tables)?:

http://www.web2pyslices.com/main/slices/take_slice/102

Good luck,

   Carlos


On Dec 20, 10:47 pm, Fabiano fabianoeng...@gmail.com wrote:
 Hi Villas,

 yes, I know this concept, I have a good background in computer
 science, but it doesn't fit here, as my data is not hierarchical.

 Anyway, thanks for the suggestion and the links, that Troels articles
 seems to be interesting, I will take a look on that sometime.

 My first e-mail was very extensive and I guess not very clear. I am
 sorry, I am still learning English. I will try to explain better what
 I am trying to do here.

 When you are modeling databases, you usually think of tables as some
 sort of classes of stuff and the records are the instances. For
 example, a table Car is a class of objects, the columns are its
 properties, like color, engine, year, model, etc. Each record on this
 table would represent a real car, with a specific a color, a specific
 year, model, etc.

 You think of the car properties that are relevant for your problem to
 select the columns you need when your are designing the tables. If
 instead of an inventory of objects you need a list of employees, or
 customer, or whatever hole that are people, you may think in
 properties like name, birth date, gender, etc.

 The thing is, usually the classes of things that you can store
 instances on your database are limited, you usually have one table for
 each class of stuff you can store and the properties of these stuff
 are pre-defined at design/data modeling time. In normal use, you just
 store new records filling the already pre-defined set of properties
 (columns).

 What I need to do is to store many different types of stuff on the
 same table, not limited to classes of stuff I can foresee in design
 phase. The properties of each record will be dynamic. This way, I may
 store a car class on my db and then say that the properties for this
 class are color, engine, model, year, etc. But on my case, I will only
 deal with properties which values can be finite sets (so, color is ok,
 year is out). You can also think of car properties as car options
 (when you buy a car, you have the option to choose its color) or as
 variations (two cars may be similar and vary only in color).

 These properties, or variations, or options are what my table Option
 was about on my first e-mail. Color is an option. OptionValue
 table stores possible values for each option. Like, for color, you may
 have values like blue, gray and white.

 On the same db I may have a class of chairs, with option material
 with values wood and metal. I may have an employee class with
 options gender and department and its possible values, I may have
 pies, cakes, cars, people or whatever, just assigning some
 properties to each of them and possible properties values..

 Each of these class may have an arbitrary number of properties,
 including none.

 In this design, instead of having a list of properties applicable for
 each class (stuff) I will list option *values* for each, and not
 options for each. This way, I may have an option color on my db with
 lots of color values stored. But when I am creating a class of stuff
 Apple, instead of assign a color property to it, I will assign
 only the available color options for it, red and green. So,
 despite having many more colors in my database, for apples I will
 have only these two, red and green. red and green values
 refers to the same option, which is color, so I can derive the options
 for each class from the list of available option values. If I had
 values blue, green, yellow, small, big for a class, I would
 derive that the options for this class are color and size for
 example.

 I think the database design is sound for what I need. My main doubts
 now are more like how to use this database under web2py and have an
 easy interface to the user that will input these stuff on the
 database. As there are a lot of relations, I don't want the user to
 insert values on each table independently and then link them later.
 When he is editing a class of stuff, I want a form that shows all
 options and options values for that class and a new option button
 which would pop up a list of option values (arranged by option names)
 that are not already assigned to the class, and also a text input that
 permits the user insert a new option and option value that is not
 already on the database.

 I think that an interface that puts all this simply and transparently
 together is the most complex part. For example, I'd like to have forms
 with transparent postback validation as I have with SQLFORM, but I'd
 have data from 4 or 5 tables together on the same screen looking like
 it is just one thing to the user.

 Thanks for your time and inputs. Kind regards,
 Fabiano.

 On 20 dez, 21:26, villas villa...@gmail.com wrote:







  Hi Fabiano
  It seems that you have a hierarchical data 

Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Thadeus Burgess
The latter.

No time to test aside from upgrading in production.

No time to develop a test application which can handle all of web2py
features (including all DAL databases)

No time to set up and maintain a server just for said tests.

--
Thadeus




2010/12/22 Branko Vukelić stu...@brankovukelic.com

 On Wed, Dec 22, 2010 at 5:05 PM, Thadeus Burgess thade...@thadeusb.com
 wrote:
  Nobody has time to work on certain things like this since most of us have
  full time jobs that may or may not be related to web2py.

 What do you mean? No time to develop a system of labeling releases or
 no time to upgrade, test, etc?

 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



[web2py] Great summary of web2py

2010-12-22 Thread Anthony
This is a great summary of the awesomeness that is web2py:
 
http://www.reddit.com/r/Python/comments/eps76/web2py_1911_is_out_the_license_has_changed_to/
 
Sadly, reddit is downvoting again, but they can't stop us. :-)
 
Anthony


Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread dcrodjer
So as a workaround what I am doing is:

try:
create_missing_folders()
except AttributeError:
pass



Is this safe? Is there  some other way that I can check if the environment 
is gae as it seems the request variable is not available in main.py .


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 7:47 AM, Branko Vukelić wrote:
 
 2010/12/22 Luis Díaz diazluis2...@gmail.com:
 
 in particular whenever new versions come out ... I always say ... have
 to wait 1 week or 2 to becomestable ...
 
 Not become stable, but be proven stable. You release, wait for
 everyone to give it a go. If everyone is happy, then it's considered
 stable, and move to stable box on the downloads page. If someone
 complains, it stays in unstable indefinitely, and a new release is
 made fixing the bugs.

The problem is that become stable is in conflict with add new features, and 
the new release that fixes the bugs also gets new (and buggy) features.

Linux has a similar problem, that gets addressed a couple of ways. One is that 
we have Linux distributions independent of (and lagging) the core kernel 
releases: Red Hat, Ubuntu, etc. The other, somewhat more recent, is that 
certain kernel releases are maintained by the core kernel developers as stable 
points. 

The web2py equivalent would be something like this. Massimo releases 1.91.1, 
and we (for some we) decide that that's a good feature/stability set for a 
stable release point. We then create a stable branch, and somebody (for some 
somebody--this is the catch) back-ports bug fixes to the stable branch, so we 
have 1.91.1.1, 1.91.1.2, etc, with *only* confirmed bug fixes, no new features, 
being back-ported. Meanwhile, trunk development proceeds with 1.91, 1.93, etc.

Problem is, maintaining stable branches requires real work, and in this 
environment it means volunteer work. 

Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 8:59 AM, dcrodjer wrote:
 So as a workaround what I am doing is:
 
 try:
 create_missing_folders()
 except AttributeError:
 pass
 
 
 Is this safe? Is there  some other way that I can check if the environment is 
 gae as it seems the request variable is not available in main.py .

Try checking global_settings.web2py_runtime_gae instead.

Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 8:20 AM, Jonathan Lundell wrote:
 
 I think that's right, Bruno. The missing-folder logic got factored out, 
 because it wasn't being invoked for any server except Rocket, but it 
 shouldn't run for GAE. However, we still want the sys.path logic, so the fix 
 should look more like this:
 
 def create_missing_folders():
if not request.env.web2py_runtime_gae:
for path in ('applications', 'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages', 
 gluon=True), )
[add_path_first(path) for path in paths]

That should be:

def create_missing_folders():
   if not global_settings.web2py_runtime_gae:
   for path in ('applications', 'deposit', 'site-packages', 'logs'):
   path = abspath(path, gluon=True)
   if not os.path.exists(path):
   os.mkdir(path)
   paths = (global_settings.gluon_parent, abspath('site-packages', gluon=True), 
)
   [add_path_first(path) for path in paths]



Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 9:05 AM, Jonathan Lundell wrote:
 
 On Dec 22, 2010, at 8:59 AM, dcrodjer wrote:
 So as a workaround what I am doing is:
 
 try:
create_missing_folders()
 except AttributeError:
pass
 
 
 Is this safe? Is there  some other way that I can check if the environment 
 is gae as it seems the request variable is not available in main.py .
 
 Try checking global_settings.web2py_runtime_gae instead.

Massimo fixed this in 1.91.2, making the call conditional.

Massimo, I don't think that's right, because we still want the sys.path logic. 
Try this instead:

def create_missing_folders():
  if not global_settings.web2py_runtime_gae:
  for path in ('applications', 'deposit', 'site-packages', 'logs'):
  path = abspath(path, gluon=True)
  if not os.path.exists(path):
  os.mkdir(path)
  paths = (global_settings.gluon_parent, abspath('site-packages', gluon=True), 
)
  [add_path_first(path) for path in paths]


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread pbreit
I do think at some point the concept of stable and new will be useful 
for newer users. stable might be a loaded word so maybe just recommended 
or something. One challenge will be how to process bug fixes on stable. A 
start may be the ability to specify a branch in admin. And new users could 
be encouraged to use the previous branch (ie, 1.90.6 vs 1.91.3).

[web2py] Re: Link to mod_wsgi.so download for py25 not working

2010-12-22 Thread pbreit
Might check here:
http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2


Re: [web2py] Version 1.91.1 GAE deployment, mkdir error

2010-12-22 Thread dcrodjer
thanks @Jonathan, It works!! Seems clean too!

[web2py] Re: use of 'timedelta' as a field

2010-12-22 Thread Luther Goh Lu Feng
Instead of using 3 fields, you could store everything in 1 field using
the lowest denomination of time that you will use, eg seconds. Then
use a function to convert the value of `seconds` to days, minutes,
hours.

On Dec 22, 3:20 pm, ron_m ron.mco...@gmail.com wrote:
 timediff is just 3 integers representing days, seconds, microseconds so you
 could decompose it and store it as 3 int fields in the DB and then use the 3
 int values in a constructor to get it back. Alternative would be to convert
 it to a float or double if you can accept rounding errors.


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 9:17 AM, pbreit wrote:
 I do think at some point the concept of stable and new will be useful for 
 newer users. stable might be a loaded word so maybe just recommended or 
 something. One challenge will be how to process bug fixes on stable. A 
 start may be the ability to specify a branch in admin. And new users could be 
 encouraged to use the previous branch (ie, 1.90.6 vs 1.91.3).

This would be a better solution if we actually had stable branches, with 
back-ported bug fixes. As it is, bug fixes are inseparable from new features, 
unless individual users are prepared to do their own patching. Which happens, 
of course, as we saw today with dcrodjer's GAE folder-creation problem, but 
isn't that useful for most users.

Formal support for stable branches would be a good indication of web2py's 
growing maturity, but somebody's got to commit the time.

(This kind of discussion also tends to go off in the regression-test 
direction)

[web2py] Re: Members database

2010-12-22 Thread Luther Goh Lu Feng
I would use the auth_user table by customising it. For members not
interested in logging in, I might create a field that flags such
users.

On Dec 22, 5:29 pm, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 Hello,

 a small design question.

 I m planing a intranet which contains a members database. Their postal
 address and some other info.

 Would you use the auth_user table to store all members or make a
 different table for it.

 - If I use auth_user what to do with members not intresered in login?

 - If I choose to make a different table, some of the members will be
 using the intranet so they their e-mailaddress would be in two places

 Kenneth


[web2py] Re: Members database

2010-12-22 Thread pbreit
I would suggesting only using auth_user for people who register and need to 
log in.

If you're just storing and publishing information like that, create a new 
table and don't worry about duplicate data. People might want to display a 
different contact email address anyway.




[web2py] Re: try web2py with cherrypy, diesel, eventlet, fapws,flup, gnuicorn, paste, rocket, tornado, twisted, wsgiref

2010-12-22 Thread ron_m
This is very interesting. I tried all the web servers I have installed

cherrypy, twisted, eventlet, rocket.

The logs say the request service speed is all about the same but twisted 
seemed slower from an unscientific response time feel of the app. I load map 
images using IMG tags in the part of the application I was testing for which 
timing is not listed in the log.

The cherrypy server refuses to quit on a control-C, but I am using the 
Ubuntu standard 10.04 Synaptic package manager load so it might be behind in 
version.

Ron


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 5:57 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 The latter.

 No time to test aside from upgrading in production.

Oh, but that's a bit upside down. web2py comes with no warranties, you
should at least test it a bit before going live. And as a double-win,
you also help judging the quality of web2py release. Just updating the
live site would be plain irresponsible, I think, even if Massimo had a
clean bug-free record. Of course, you can do it anyway if it's not a
mission-critical site (not too many users, or very forgiving users,
etc), but for an important site, it's just not a good practice in
general, regardless of web2py's release scheme.

 No time to develop a test application which can handle all of web2py
 features (including all DAL databases)

That's why I suggested the unstable-stable scheme in the first place.
Test unstable. If it's good for you, shoot a message to mailing list
(if you want), and deploy it. If it's not good, then shoot a bug
report to the mailing list, and Massimo can roll out the bugfix
release soon after that. Rinse, repeat.

 No time to set up and maintain a server just for said tests.

See above about the said tests. On the other hand, I don't think it
would be too crazy to make a test server (or even a test virtual host)
just for testing the potential candidate for live deployment.

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] form.accepts = False. How to find out why

2010-12-22 Thread Johann Spies
I have the following controller:
===
def show_fpipl01():
   tabel = request.vars.tabel
   tb = tabel.lower()
   if auth.user_id in [21,22]: # Johann Spies (22) or ERA (21)
  rdata = db((db.service_provider.id == db[tb].service_provider)
 ).select(db[tb].id,
  db.service_provider.name,
  db[tb].date,db.fpipl01.trainer,
  db[tb].focus)


   else:
  rdata = db((db[tb].created_by==auth.user_id) 
 (db.service_provider.id == db[tb].service_provider)
 ).select(db[tb].id,
  db.service_provider.name,
  db[tb].date,db.fpipl01.trainer,
  db[tb].focus)

   ids = []
   for row in rdata:
  ids.append( row['fpipl01']['id'])
   data = SQLTABLE(rdata,
   headers = {'fpipl01.id' : 'ID', '
service_provider.name' : 'Service Provider',
  'fpipl01.date': 'Date', 'fpipl01.trainer':
'Trainer',
  'fpipl01.focus': 'Focus of training'},
   truncate = 50
   )
   form = SQLFORM.factory(Field('id', requires = IS_IN_SET(ids),
   label = Which event (number)?)
 )
   if form.accepts(request.vars, session):
  redirect(URL(r=request,
f='show_fpipl01_data',vars=dict(id=id)))
   else:
  response.flash= 'Form not accepted'

   return dict(data=data,tabel=tabel,form=form)
=

form.accepts never suceeds so no redirection takes place although
request.vars show:

id:
2
tabel:
FPIPL01

So how do I find out why form.accepts does not succeed?

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Bruno Rocha
I see the need to organize a test team

Some ideas:
https://wiki.ubuntu.com/Testing
https://wiki.ubuntu.com/Testinghttps://wiki.ubuntu.com/Testing/LoCoTeam
http://ubuntutesting.wordpress.com/2010/08/06/desktop-testing-team/
https://launchpad.net/~desktop-testing-team

Or, we can organizze Local Sprints for testing new major releases. (jus like
python does)

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: form.accepts = False. How to find out why

2010-12-22 Thread villas
form.accepts is a filter that moves request.vars into form.vars after
parsing and also populates form.errors.

Looking at form.errors should help.


On Dec 22, 6:58 pm, Johann Spies johann.sp...@gmail.com wrote:
 I have the following controller:
 ===
 def show_fpipl01():
        tabel = request.vars.tabel
        tb = tabel.lower()
        if auth.user_id in [21,22]: # Johann Spies (22) or ERA (21)
               rdata = db((db.service_provider.id == db[tb].service_provider)
                          ).select(db[tb].id,
                                   db.service_provider.name,
                                   db[tb].date,db.fpipl01.trainer,
                                   db[tb].focus)

        else:
               rdata = db((db[tb].created_by==auth.user_id) 
                          (db.service_provider.id == db[tb].service_provider)
                          ).select(db[tb].id,
                                   db.service_provider.name,
                                   db[tb].date,db.fpipl01.trainer,
                                   db[tb].focus)

        ids = []
        for row in rdata:
               ids.append( row['fpipl01']['id'])
        data = SQLTABLE(rdata,
                        headers = {'fpipl01.id' : 'ID', '
 service_provider.name' : 'Service Provider',
                                   'fpipl01.date': 'Date', 'fpipl01.trainer':
 'Trainer',
                                   'fpipl01.focus': 'Focus of training'},
                        truncate = 50
                        )
        form = SQLFORM.factory(Field('id', requires = IS_IN_SET(ids),
                                    label = Which event (number)?)
                              )
        if form.accepts(request.vars, session):
               redirect(URL(r=request,
 f='show_fpipl01_data',vars=dict(id=id)))
        else:
               response.flash= 'Form not accepted'

        return dict(data=data,tabel=tabel,form=form)
 =

 form.accepts never suceeds so no redirection takes place although
 request.vars show:

 id:
 2
 tabel:
 FPIPL01

 So how do I find out why form.accepts does not succeed?

 Regards
 Johann

 --
  May grace and peace be yours in abundance through the full knowledge of God
 and of Jesus our Lord!  His divine power has given us everything we need for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
                                                     2 Pet. 1:2b,3a


[web2py] Re: The stability of web2py releases

2010-12-22 Thread mdipierro
The idea was to have stable and nightly-build. The problem is that
very few people check the nightly build.

On Dec 22, 11:17 am, pbreit pbreitenb...@gmail.com wrote:
 I do think at some point the concept of stable and new will be useful
 for newer users. stable might be a loaded word so maybe just recommended
 or something. One challenge will be how to process bug fixes on stable. A
 start may be the ability to specify a branch in admin. And new users could
 be encouraged to use the previous branch (ie, 1.90.6 vs 1.91.3).


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 8:29 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 The idea was to have stable and nightly-build. The problem is that
 very few people check the nightly build.

Well, yeah, it's because it's sounds like a nightly TRUNK dump. :)
It's better to make a 'incubation release' or something like that, so
it's obvious that it's a release. And when it's hatched, you can label
it safe-for-production. I don't know if people would use them, though.
They might still go yuck and decide it's just like nightly, with a
fancy name. :D


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Vasile Ermicioi
that means we prefer a stable one :)


[web2py] Re: form.accepts = False. How to find out why

2010-12-22 Thread mdipierro
I think because

Field('id', requires = IS_IN_SET(ids),

id in the form is a string and ids in the set are integers.

On Dec 22, 1:19 pm, villas villa...@gmail.com wrote:
 form.accepts is a filter that moves request.vars into form.vars after
 parsing and also populates form.errors.

 Looking at form.errors should help.

 On Dec 22, 6:58 pm, Johann Spies johann.sp...@gmail.com wrote:

  I have the following controller:
  ===
  def show_fpipl01():
         tabel = request.vars.tabel
         tb = tabel.lower()
         if auth.user_id in [21,22]: # Johann Spies (22) or ERA (21)
                rdata = db((db.service_provider.id == db[tb].service_provider)
                           ).select(db[tb].id,
                                    db.service_provider.name,
                                    db[tb].date,db.fpipl01.trainer,
                                    db[tb].focus)

         else:
                rdata = db((db[tb].created_by==auth.user_id) 
                           (db.service_provider.id == db[tb].service_provider)
                           ).select(db[tb].id,
                                    db.service_provider.name,
                                    db[tb].date,db.fpipl01.trainer,
                                    db[tb].focus)

         ids = []
         for row in rdata:
                ids.append( row['fpipl01']['id'])
         data = SQLTABLE(rdata,
                         headers = {'fpipl01.id' : 'ID', '
  service_provider.name' : 'Service Provider',
                                    'fpipl01.date': 'Date', 'fpipl01.trainer':
  'Trainer',
                                    'fpipl01.focus': 'Focus of training'},
                         truncate = 50
                         )
         form = SQLFORM.factory(Field('id', requires = IS_IN_SET(ids),
                                     label = Which event (number)?)
                               )
         if form.accepts(request.vars, session):
                redirect(URL(r=request,
  f='show_fpipl01_data',vars=dict(id=id)))
         else:
                response.flash= 'Form not accepted'

         return dict(data=data,tabel=tabel,form=form)
  =

  form.accepts never suceeds so no redirection takes place although
  request.vars show:

  id:
  2
  tabel:
  FPIPL01

  So how do I find out why form.accepts does not succeed?

  Regards
  Johann

  --
   May grace and peace be yours in abundance through the full knowledge of God
  and of Jesus our Lord!  His divine power has given us everything we need for
  life and godliness through the full knowledge of the one who called us by
  his own glory and excellence.
                                                      2 Pet. 1:2b,3a




[web2py] Re: The stability of web2py releases

2010-12-22 Thread mdipierro
We can change the name. It is not truly a nigthly built. it is closer
to a release candidate even if the final release is not equivalent to
the latest nightly built.

On Dec 22, 1:31 pm, Branko Vukelić stu...@brankovukelic.com wrote:
 On Wed, Dec 22, 2010 at 8:29 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  The idea was to have stable and nightly-build. The problem is that
  very few people check the nightly build.

 Well, yeah, it's because it's sounds like a nightly TRUNK dump. :)
 It's better to make a 'incubation release' or something like that, so
 it's obvious that it's a release. And when it's hatched, you can label
 it safe-for-production. I don't know if people would use them, though.
 They might still go yuck and decide it's just like nightly, with a
 fancy name. :D

 --
 Branko Vukelic

 stu...@brankovukelic.comhttp://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Anthony
Also, you probably need some kind of announcement to prompt testing -- 
there's nothing prompting people to check the nightly build (or even to know 
when anything substantial has been added to it). When a new .1 release 
(e.g., 1.91.1) is announced (usually with a list of new features), that 
prompts people to check it out. Maybe instead of starting with .1, start 
with a release candidate (e.g., 1.92.0rc or something), then spend a few 
days debugging before releasing a more stable .1 (so what we currently call 
.1 would become the RC, and what currently ends up being .3 or .4 would be 
.1). Essentially the same behavior as now, just slightly different labeling. 
That's not to say we couldn't use other improvements to the process (e.g., 
more systematic testing), but this might be a simple change.
 
Anthony

On Wednesday, December 22, 2010 2:31:45 PM UTC-5, stu...@brankovukelic.com 
wrote:

 On Wed, Dec 22, 2010 at 8:29 PM, mdipierro mdip...@cs.depaul.edu wrote:
  The idea was to have stable and nightly-build. The problem is that
  very few people check the nightly build. 

 Well, yeah, it's because it's sounds like a nightly TRUNK dump. :)
 It's better to make a 'incubation release' or something like that, so
 it's obvious that it's a release. And when it's hatched, you can label
 it safe-for-production. I don't know if people would use them, though.
 They might still go yuck and decide it's just like nightly, with a
 fancy name. :D 


 -- 
 Branko Vukelic 

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Anthony
Oh, also, I noticed a typo on the website -- it says Nightly Built instead 
of Nightly Build. Maybe that's the problem. ;-)
 


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 8:47 PM, Anthony abasta...@gmail.com wrote:
 Oh, also, I noticed a typo on the website -- it says Nightly Built instead
 of Nightly Build. Maybe that's the problem. ;-)

Is there a typo on this planet that can evade Anthony? :D


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Anthony
Please, don't encourage me. :D

On Wednesday, December 22, 2010 3:13:32 PM UTC-5, stu...@brankovukelic.com 
wrote:

 On Wed, Dec 22, 2010 at 8:47 PM, Anthony abas...@gmail.com wrote:
  Oh, also, I noticed a typo on the website -- it says Nightly Built 
 instead
  of Nightly Build. Maybe that's the problem. ;-) 

 Is there a typo on this planet that can evade Anthony? :D 


 -- 
 Branko Vukelic 

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 11:42 AM, mdipierro wrote:
 
 We can change the name. It is not truly a nigthly built. it is closer
 to a release candidate even if the final release is not equivalent to
 the latest nightly built.

I'm sounding like a broken record here (remember those?), but in view of the 
rapid pace of web2py feature development, I don't think we can really achieve 
stability without separate, stable branches that allow *only* low-risk, 
reviewed bug fixes.

And that doesn't come for free; it requires time (and discipline).



Re: [web2py] Re: form.accepts = False. How to find out why

2010-12-22 Thread Johann Spies
On 22 December 2010 21:32, mdipierro mdipie...@cs.depaul.edu wrote:

 I think because

 Field('id', requires = IS_IN_SET(ids),

 id in the form is a string and ids in the set are integers.


Thanks for your answer. Changing the definition to

form = SQLFORM.factory(Field('id', 'integer', requires = IS_IN_SET(ids),
   label = Which event (number)?)

did not solve the problem however :(

How do I debug this?

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Full text search again

2010-12-22 Thread mdipierro
Somebody posted an interesting question on Stack Overflow:

http://stackoverflow.com/questions/4512181/web2py-like-equivalents-with-google-app-engine/4513397#4513397

please please ... ask questions here.


Re: [web2py] Simple debugger

2010-12-22 Thread Johann Spies
On 14 December 2010 06:45, Bruno Rocha rochacbr...@gmail.com wrote:


 At model defined:

 code
 #debugger
 def dbg(*attributes):
 print '---\n'
 print attributes
 while not raw_input('\nPRESS TO CONTINUE\n'):
 break
 /code


 I get this when I use your code (and the python process dies):

/Users/js/Programmeer/zenex/web2py/gluon/tools.py:3798: DeprecationWarning:
object.__new__() takes no parameters
  instance = object.__new__(cls,*a,**b)
--

(gluon.sqlhtml.SQLFORM object at 0x18575470,)

PRESS TO CONTINUE
Tcl_WaitForEvent: CFRunLoop not initialized
Abort trap

Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


Re: [web2py] Re: form.accepts = False. How to find out why

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 12:22 PM, Johann Spies wrote:
 On 22 December 2010 21:32, mdipierro mdipie...@cs.depaul.edu wrote:
 I think because
 
 Field('id', requires = IS_IN_SET(ids),
 
 id in the form is a string and ids in the set are integers.
 
 
 Thanks for your answer. Changing the definition to 
 
 form = SQLFORM.factory(Field('id', 'integer', requires = IS_IN_SET(ids),
label = Which event (number)?)
 
 did not solve the problem however :(
 
 How do I debug this?

When accepts() returns False, look at form.errors. It's a dict (Storage, 
actually, but you can treat it as a dict) that is keyed, typically, by field 
names, with error messages as values.

(accepts() will also return False before the form has been submitted, but in 
that case form.errors is empty.)

Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Michele Comitini
Web2py supports unit testing.  Why not have an app with controller(s)
that can be tested for each solved bug?
 this would reduce at least regressions.  Kinda continuos integration system

2010/12/22 Jonathan Lundell jlund...@pobox.com:
 On Dec 22, 2010, at 11:42 AM, mdipierro wrote:

 We can change the name. It is not truly a nigthly built. it is closer
 to a release candidate even if the final release is not equivalent to
 the latest nightly built.

 I'm sounding like a broken record here (remember those?), but in view of the 
 rapid pace of web2py feature development, I don't think we can really achieve 
 stability without separate, stable branches that allow *only* low-risk, 
 reviewed bug fixes.

 And that doesn't come for free; it requires time (and discipline).




Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
On Wed, Dec 22, 2010 at 9:38 PM, Michele Comitini
michele.comit...@gmail.com wrote:
 Web2py supports unit testing.  Why not have an app with controller(s)
 that can be tested for each solved bug?
  this would reduce at least regressions.  Kinda continuos integration system

That also requires time and discipline, if I'm not mistaken. :)

The current way of testing (open-compaint system) is totally cool.
What I mean is, it works. People get stuck, they complain, Massimo
fixes. It's about how to get people to test-deploy apps with unstable
releases instead of going WTF?! when deploying a new release. I
think that would be less time-consuming, and less frustrating for end
users as well.



-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: The stability of web2py releases

2010-12-22 Thread Stefaan Himpe



Is there a typo on this planet that can evade Anthony? :D


While we're on the subject... *cough*experts4solutions.com*cough*
Its typos still make my eyes bleed :p





[web2py] Re: Full text search again

2010-12-22 Thread weheh
Massimo, how is this full text search? It seems to search
db.data.title only? What if you had a file that you wanted to search?
Would you tokenize it as you did in your example? I'm going to run
into this issue, soon. I want to search a database of documents
(stored in files).


[web2py] Re: The stability of web2py releases

2010-12-22 Thread Michael McGinnis
I'd like to help fix those typos. Let me know how I can get started.

Michael McGinnis
michael.d.mcgin...@gmail.com

On Dec 22, 4:01 pm, Stefaan Himpe stefaan.hi...@gmail.com wrote:
  Is there a typo on this planet that can evade Anthony? :D

 While we're on the subject... *cough*experts4solutions.com*cough*
 Its typos still make my eyes bleed :p


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Branko Vukelić
Shoot Massimo an e-mail. I'm sure he'd be happy to hear from you.

On Wed, Dec 22, 2010 at 11:37 PM, Michael McGinnis
ish...@biographiks.com wrote:
 I'd like to help fix those typos. Let me know how I can get started.

 Michael McGinnis
 michael.d.mcgin...@gmail.com

 On Dec 22, 4:01 pm, Stefaan Himpe stefaan.hi...@gmail.com wrote:
  Is there a typo on this planet that can evade Anthony? :D

 While we're on the subject... *cough*experts4solutions.com*cough*
 Its typos still make my eyes bleed :p




-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: Problem when trying to upload a file in web2py 1.90.4

2010-12-22 Thread Charis
I define the db using:

db = DAL('sqlite://db.db')

db.define_table('database',
SQLField('email','string'),
SQLField('data','upload')
)


I create a form using

form = SQLFORM.factory(db.database.email,db.database.data)

The form appears correctly but when i try to submit a file i get the
following error: (the problem seems to be in dal.py at line 4141 where
path == '' or path.endswith('/') )

File /home/charis/Desktop/test/gluon/dal.py in store at line 4141
if path:
pass
elif self.uploadfolder:
path = self.uploadfolder
else:
path = os.path.join(self.db._adapter.folder, '..',
'uploads')

if self.uploadseparate:
path = os.path.join(path,%s.%s % (self._tablename,
self.name),uuid_key[:2])
if not os.path.exists(path):
os.makedirs(path)

File /usr/lib/python2.6/posixpath.py in join at line 67
will be discarded.
path = a
for b in p:
if b.startswith('/'):
path = b
elif path == '' or path.endswith('/'):

path +=  b
else:
path += '/' + b
return path



On Dec 20, 2:03 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I cannot reproduce the problem. What db?

 On Dec 19, 6:39 pm, Charis charalambos.chrysosto...@gmail.com wrote:







  I have the following error message when i try to upload a file in
  web2py 1.90.4. This feature was working fine for me with the previews
  versions.

  Traceback (most recent call last):
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/restricted.py,
  line 188, in restricted
      exec ccode in environment
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
  controllers/default.py, line 150, in module
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/globals.py,
  line 95, in lambda
      self._caller = lambda f: f()
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
  controllers/default.py, line 15, in index
      if form.accepts(request.vars, session):
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/sqlhtml.py,
  line 1104, in accepts
      newfilename = field.store(source_file, original_filename)
    File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/dal.py, line
  4132, in store
      path = os.path.join(self.db._adapter.folder, '..', 'uploads')
    File /usr/lib/python2.6/posixpath.py, line 67, in join
      elif path == '' or path.endswith('/'):
  AttributeError: 'NoneType' object has no attribute 'endswith'


[web2py] Re: Full text search again

2010-12-22 Thread mdipierro
it is not full text search. The title is wrong. It is a way to for
keywords in one or more fields.

On Dec 22, 4:30 pm, weheh richard_gor...@verizon.net wrote:
 Massimo, how is this full text search? It seems to search
 db.data.title only? What if you had a file that you wanted to search?
 Would you tokenize it as you did in your example? I'm going to run
 into this issue, soon. I want to search a database of documents
 (stored in files).


[web2py] couchdb support again

2010-12-22 Thread mdipierro
This now works with dal in trunk:

from gluon.dal import DAL, Field
db=DAL('couchdb://127.0.0.1:5984')
db.define_table('person',Field('name'),Field('age','integer',default=2))
id=db.person.insert(name='Jim')
print id
print db.person(id)
print db(db.person.id==id).update(name=john, age=5)
print db.person(id)
for row in db(db.person.name=='john').select(): print 'row:',row
assert(db(db.person.name=='john').update(name='Tim')==1)
assert(db(db.person.name=='Tim').count()==1)
del db.person[id]
assert(db(db.person.name=='Tim').delete()==0)


I am not sure about boolean, date, time and datetime fields in
searches.
If you can help with tests please report here.

print db(db.person.name=='john')._select()[0]

return the JS code used for the query



Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Plumo
agreed. Less overhead to releases means new features get added faster.

[web2py] couchdb support again

2010-12-22 Thread mdipierro
This now works with dal in trunk:

from gluon.dal import DAL, Field
db=DAL('couchdb://127.0.0.1:5984')
db.define_table('person',Field('name'),Field('age','integer',default=2))
id=db.person.insert(name='Jim')
print id
print db.person(id)
print db(db.person.id==id).update(name=john, age=5)
print db.person(id)
for row in db(db.person.name=='john').select(): print 'row:',row
assert(db(db.person.name=='john').update(name='Tim')==1)
assert(db(db.person.name=='Tim').count()==1)
del db.person[id]
assert(db(db.person.name=='Tim').delete()==0)


I am not sure about boolean, date, time and datetime fields in
searches.
If you can help with tests please report here.

print db(db.person.name=='john')._select()[0]

return the JS code used for the query



[web2py] Encountering problem with a computer field

2010-12-22 Thread Magnitus
Hi,

btw, I upgraded from 1.87 to 1.91 to see if the problem would get
resolved and 1.91 is loading my pages significantly faster. Also, the
revised version of the pdf manual is greatly superior to the original.
Thank you for that.

So, I tried to get fancy and use a computer field in my model and now
I'm getting an error (serves me right for trying to be fancy).

Either I'm doing something wrong or there is a bug. If I'm doing
something wrong, I'd like to know.

the relevant entry in model is as follow:

Forums_db.define_table('Forum_poster',
Field('Alias', 'string', length=128, required=True),
Field('Alias_ordinal', 'integer', default=1),
Field('Alias_apparent', compute=lambda r: (r['Alias'] if
r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
+']')),
Field('Email', length=128, required=True),
Field('Number_of_posts', 'integer', default=0),
Field('Banned', 'boolean', default=False))

Whenever I try to write in the DB (insert or update), I get a key
error on 'Alias_ordinal'.

The relevant parts of the error log are as follow:

Last entry pertaining to my code:

  File applications\Ascent\modules\Forum_tools.py, line 140, in
Submit_thread
 
DB(DB.Forum_poster.id==Poster['ID']).update(Number_of_posts=Poster['Number_of_posts']
+1)

Last entry pertaining to gluon internals:

  File G:/Game_0_42/Code/web2py/applications/Ascent/models/
Forums.py, line 21, in lambda
Field('Alias_apparent', compute=lambda r: (r['Alias'] if
r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
+']')),
  File G:\Game_42\Code\web2py\gluon\dal.py, line 3054, in
__getitem__
return dict.__getitem__(self, key)
KeyError: 'Alias_ordinal'

Some additional debug info from the log:

Function argument list

(self=Row {'Number_of_posts': 1}, key='Alias_ordinal')
Code listing


def __getitem__(self, key):
key=str(key)
if key in self.get('_extra',{}):
return self._extra[key]
return dict.__getitem__(self, key)


def __call__(self,key):
key=str(key)
if key in self.get('_extra',{}):

Variables
selfRow {'Number_of_posts': 1}
dict.__getitem__method '__getitem__' of 'dict' objects
builtindict type 'dict'
key 'Alias_ordinal'

Any help in diagnosing the problem would be greatly appreciated.
Thanks.


[web2py] Sharing sessions and authentication

2010-12-22 Thread Marin Pranjic
Hi there,
I need to make few apps that will share sessions.
For testing purposes, i have applications shared, app1 and app2.

In application shared, i have:


db = DAL('sqlite://storage.sqlite')
session.connect(request, response, db = db)
(...)


in applications app1 and app2 i have:


db = DAL('sqlite://../../shared/databases/storage.sqlite')
session.connect(request, response, db = db, masterapp = 'shared')
(...)
auth.define_tables(migrate = False)
(...)


folders app1/databases and app2/databases do not have any databases,
which means they use database from shared. Did that part right :)

The funny part starts here:
If I register new user via application shared, I cannot login from
app1 nor app2, only from app shared. Once I log in application
shared, I'm logged in all three applications.
If I register new user via applicaton app1, i cannot login from
shared, but can from both app1 and app2. After loggind, the same
situation as above, I'm logged in all three applications.


I guess i won't have any headaches with this one, because application
shared will be 'hidden' and users will not register accounts using
registration form on that app. It should be enough, but that does not
solve the problem. I created another application app3, and managed
to login to all accounts which I made from app1 or app2. Could not
login to accounts from shared (just wanted to make sure I got it
right).

I don't know if this is a web2py bug or a feature, and if it is a
feature, why  howto fix (if possible).

p.s. I used applications generated by framework, i edited only the
lines mentioned above.


[web2py] Re: Encountering problem with a computer field

2010-12-22 Thread mdipierro
The problem is that you have compute attribute set at table definition
so web2py tries to use it at every insert and every update. Even if in
your update you is has no knowledge of the previous Alias_ordinal
because you only updating Number_of_posts.

There are two solutions... set db.table.field.compute=... only in the
actions that need it.

I can add a try except so that web2py does not tries to compute fields
when there is not enough information. The downside is that a typo will
result in a silent failure to compute. Perhaps we should do this
anyway.

Massimo


On Dec 22, 4:56 pm, Magnitus fbunny2...@hotmail.com wrote:
 Hi,

 btw, I upgraded from 1.87 to 1.91 to see if the problem would get
 resolved and 1.91 is loading my pages significantly faster. Also, the
 revised version of the pdf manual is greatly superior to the original.
 Thank you for that.

 So, I tried to get fancy and use a computer field in my model and now
 I'm getting an error (serves me right for trying to be fancy).

 Either I'm doing something wrong or there is a bug. If I'm doing
 something wrong, I'd like to know.

 the relevant entry in model is as follow:

 Forums_db.define_table('Forum_poster',
     Field('Alias', 'string', length=128, required=True),
     Field('Alias_ordinal', 'integer', default=1),
     Field('Alias_apparent', compute=lambda r: (r['Alias'] if
 r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
 +']')),
     Field('Email', length=128, required=True),
     Field('Number_of_posts', 'integer', default=0),
     Field('Banned', 'boolean', default=False))

 Whenever I try to write in the DB (insert or update), I get a key
 error on 'Alias_ordinal'.

 The relevant parts of the error log are as follow:

 Last entry pertaining to my code:

   File applications\Ascent\modules\Forum_tools.py, line 140, in
 Submit_thread

 DB(DB.Forum_poster.id==Poster['ID']).update(Number_of_posts=Poster['Number_of_posts']
 +1)

 Last entry pertaining to gluon internals:

   File G:/Game_0_42/Code/web2py/applications/Ascent/models/
 Forums.py, line 21, in lambda
     Field('Alias_apparent', compute=lambda r: (r['Alias'] if
 r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
 +']')),
   File G:\Game_42\Code\web2py\gluon\dal.py, line 3054, in
 __getitem__
     return dict.__getitem__(self, key)
 KeyError: 'Alias_ordinal'

 Some additional debug info from the log:

 Function argument list

 (self=Row {'Number_of_posts': 1}, key='Alias_ordinal')
 Code listing

     def __getitem__(self, key):
         key=str(key)
         if key in self.get('_extra',{}):
             return self._extra[key]
 return dict.__getitem__(self, key)

     def __call__(self,key):
         key=str(key)
         if key in self.get('_extra',{}):

 Variables
 self    Row {'Number_of_posts': 1}
 dict.__getitem__        method '__getitem__' of 'dict' objects
 builtindict     type 'dict'
 key     'Alias_ordinal'

 Any help in diagnosing the problem would be greatly appreciated.
 Thanks.


[web2py] Re: Sharing sessions and authentication

2010-12-22 Thread mdipierro
This smells like a bug or web2py is picking up some leftover sessions
from cookies.

Try this: delete everything in the sessions/ folder of the three apps.

If you still have the problem I will try reproduce the problem and fix
it.

Massimo

On Dec 22, 5:40 pm, Marin Pranjic marin.pran...@gmail.com wrote:
 Hi there,
 I need to make few apps that will share sessions.
 For testing purposes, i have applications shared, app1 and app2.

 In application shared, i have:

 db = DAL('sqlite://storage.sqlite')
 session.connect(request, response, db = db)
 (...)

 in applications app1 and app2 i have:

 db = DAL('sqlite://../../shared/databases/storage.sqlite')
 session.connect(request, response, db = db, masterapp = 'shared')
 (...)
 auth.define_tables(migrate = False)
 (...)

 folders app1/databases and app2/databases do not have any databases,
 which means they use database from shared. Did that part right :)

 The funny part starts here:
 If I register new user via application shared, I cannot login from
 app1 nor app2, only from app shared. Once I log in application
 shared, I'm logged in all three applications.
 If I register new user via applicaton app1, i cannot login from
 shared, but can from both app1 and app2. After loggind, the same
 situation as above, I'm logged in all three applications.

 I guess i won't have any headaches with this one, because application
 shared will be 'hidden' and users will not register accounts using
 registration form on that app. It should be enough, but that does not
 solve the problem. I created another application app3, and managed
 to login to all accounts which I made from app1 or app2. Could not
 login to accounts from shared (just wanted to make sure I got it
 right).

 I don't know if this is a web2py bug or a feature, and if it is a
 feature, why  howto fix (if possible).

 p.s. I used applications generated by framework, i edited only the
 lines mentioned above.


[web2py] Re: Problem when trying to upload a file in web2py 1.90.4

2010-12-22 Thread mdipierro
The problem is thet you have an upload field is a form that is not
connected to a database (because you are using a factory). web2py does
not know what to do with the file. You need to specify the
uploadfolder.

uf=os.path.join(request.folder,'uploads')
form =
SQLFORM.factory(Field('email','string'),Field('data','upload',uploadfolder=uf))

Massimo

On Dec 22, 4:49 pm, Charis charalambos.chrysosto...@gmail.com wrote:
 I define the db using:

 db = DAL('sqlite://db.db')

 db.define_table('database',
                 SQLField('email','string'),
                 SQLField('data','upload')
                 )

 I create a form using

 form = SQLFORM.factory(db.database.email,db.database.data)

 The form appears correctly but when i try to submit a file i get the
 following error: (the problem seems to be in dal.py at line 4141 where
 path == '' or path.endswith('/') )

 File /home/charis/Desktop/test/gluon/dal.py in store at line 4141
             if path:
                 pass
             elif self.uploadfolder:
                 path = self.uploadfolder
             else:
                 path = os.path.join(self.db._adapter.folder, '..',
 'uploads')

             if self.uploadseparate:
                 path = os.path.join(path,%s.%s % (self._tablename,
 self.name),uuid_key[:2])
             if not os.path.exists(path):
                 os.makedirs(path)

 File /usr/lib/python2.6/posixpath.py in join at line 67
     will be discarded.
     path = a
     for b in p:
         if b.startswith('/'):
             path = b
         elif path == '' or path.endswith('/'):

             path +=  b
         else:
             path += '/' + b
     return path

 On Dec 20, 2:03 am, mdipierro mdipie...@cs.depaul.edu wrote:

  I cannot reproduce the problem. What db?

  On Dec 19, 6:39 pm, Charis charalambos.chrysosto...@gmail.com wrote:

   I have the following error message when i try to upload a file in
   web2py 1.90.4. This feature was working fine for me with the previews
   versions.

   Traceback (most recent call last):
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/restricted.py,
   line 188, in restricted
       exec ccode in environment
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
   controllers/default.py, line 150, in module
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/globals.py,
   line 95, in lambda
       self._caller = lambda f: f()
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
   controllers/default.py, line 15, in index
       if form.accepts(request.vars, session):
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/sqlhtml.py,
   line 1104, in accepts
       newfilename = field.store(source_file, original_filename)
     File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/dal.py, line
   4132, in store
       path = os.path.join(self.db._adapter.folder, '..', 'uploads')
     File /usr/lib/python2.6/posixpath.py, line 67, in join
       elif path == '' or path.endswith('/'):
   AttributeError: 'NoneType' object has no attribute 'endswith'




Re: [web2py] Re: Sharing sessions and authentication

2010-12-22 Thread Marin Pranjic
Hi Massimo,

I had that in mind already. And doublechecked. No sessions in folders. I
cleared the session table using appadmin on shared.
Resulting:
Stil cannot login from app1 to account created by shared.
I just created another account in shared registration forum. Cannot login
from app2.

You should try to reproduce, since it takes only few minutes.

On Thu, Dec 23, 2010 at 1:07 AM, mdipierro mdipie...@cs.depaul.edu wrote:

 This smells like a bug or web2py is picking up some leftover sessions
 from cookies.

 Try this: delete everything in the sessions/ folder of the three apps.

 If you still have the problem I will try reproduce the problem and fix
 it.

 Massimo

 On Dec 22, 5:40 pm, Marin Pranjic marin.pran...@gmail.com wrote:
  Hi there,
  I need to make few apps that will share sessions.
  For testing purposes, i have applications shared, app1 and app2.
 
  In application shared, i have:
 
  db = DAL('sqlite://storage.sqlite')
  session.connect(request, response, db = db)
  (...)
 
  in applications app1 and app2 i have:
 
  db = DAL('sqlite://../../shared/databases/storage.sqlite')
  session.connect(request, response, db = db, masterapp = 'shared')
  (...)
  auth.define_tables(migrate = False)
  (...)
 
  folders app1/databases and app2/databases do not have any databases,
  which means they use database from shared. Did that part right :)
 
  The funny part starts here:
  If I register new user via application shared, I cannot login from
  app1 nor app2, only from app shared. Once I log in application
  shared, I'm logged in all three applications.
  If I register new user via applicaton app1, i cannot login from
  shared, but can from both app1 and app2. After loggind, the same
  situation as above, I'm logged in all three applications.
 
  I guess i won't have any headaches with this one, because application
  shared will be 'hidden' and users will not register accounts using
  registration form on that app. It should be enough, but that does not
  solve the problem. I created another application app3, and managed
  to login to all accounts which I made from app1 or app2. Could not
  login to accounts from shared (just wanted to make sure I got it
  right).
 
  I don't know if this is a web2py bug or a feature, and if it is a
  feature, why  howto fix (if possible).
 
  p.s. I used applications generated by framework, i edited only the
  lines mentioned above.


[web2py] Re: Sharing sessions and authentication

2010-12-22 Thread mdipierro
I cannot today but I will tomorrow. ;-)

On Dec 22, 6:18 pm, Marin Pranjic marin.pran...@gmail.com wrote:
 Hi Massimo,

 I had that in mind already. And doublechecked. No sessions in folders. I
 cleared the session table using appadmin on shared.
 Resulting:
 Stil cannot login from app1 to account created by shared.
 I just created another account in shared registration forum. Cannot login
 from app2.

 You should try to reproduce, since it takes only few minutes.

 On Thu, Dec 23, 2010 at 1:07 AM, mdipierro mdipie...@cs.depaul.edu wrote:
  This smells like a bug or web2py is picking up some leftover sessions
  from cookies.

  Try this: delete everything in the sessions/ folder of the three apps.

  If you still have the problem I will try reproduce the problem and fix
  it.

  Massimo

  On Dec 22, 5:40 pm, Marin Pranjic marin.pran...@gmail.com wrote:
   Hi there,
   I need to make few apps that will share sessions.
   For testing purposes, i have applications shared, app1 and app2.

   In application shared, i have:

   db = DAL('sqlite://storage.sqlite')
   session.connect(request, response, db = db)
   (...)

   in applications app1 and app2 i have:

   db = DAL('sqlite://../../shared/databases/storage.sqlite')
   session.connect(request, response, db = db, masterapp = 'shared')
   (...)
   auth.define_tables(migrate = False)
   (...)

   folders app1/databases and app2/databases do not have any databases,
   which means they use database from shared. Did that part right :)

   The funny part starts here:
   If I register new user via application shared, I cannot login from
   app1 nor app2, only from app shared. Once I log in application
   shared, I'm logged in all three applications.
   If I register new user via applicaton app1, i cannot login from
   shared, but can from both app1 and app2. After loggind, the same
   situation as above, I'm logged in all three applications.

   I guess i won't have any headaches with this one, because application
   shared will be 'hidden' and users will not register accounts using
   registration form on that app. It should be enough, but that does not
   solve the problem. I created another application app3, and managed
   to login to all accounts which I made from app1 or app2. Could not
   login to accounts from shared (just wanted to make sure I got it
   right).

   I don't know if this is a web2py bug or a feature, and if it is a
   feature, why  howto fix (if possible).

   p.s. I used applications generated by framework, i edited only the
   lines mentioned above.




Re: [web2py] Re: Sharing sessions and authentication

2010-12-22 Thread Marin Pranjic
No prob.
I deleted all Recent history in browser, and tried again with the same
result.
Pretty sure it's not about cookies :)

On Thu, Dec 23, 2010 at 1:20 AM, mdipierro mdipie...@cs.depaul.edu wrote:

 I cannot today but I will tomorrow. ;-)

 On Dec 22, 6:18 pm, Marin Pranjic marin.pran...@gmail.com wrote:
  Hi Massimo,
 
  I had that in mind already. And doublechecked. No sessions in folders. I
  cleared the session table using appadmin on shared.
  Resulting:
  Stil cannot login from app1 to account created by shared.
  I just created another account in shared registration forum. Cannot
 login
  from app2.
 
  You should try to reproduce, since it takes only few minutes.
 
  On Thu, Dec 23, 2010 at 1:07 AM, mdipierro mdipie...@cs.depaul.edu
 wrote:
   This smells like a bug or web2py is picking up some leftover sessions
   from cookies.
 
   Try this: delete everything in the sessions/ folder of the three apps.
 
   If you still have the problem I will try reproduce the problem and fix
   it.
 
   Massimo
 
   On Dec 22, 5:40 pm, Marin Pranjic marin.pran...@gmail.com wrote:
Hi there,
I need to make few apps that will share sessions.
For testing purposes, i have applications shared, app1 and
 app2.
 
In application shared, i have:
 
db = DAL('sqlite://storage.sqlite')
session.connect(request, response, db = db)
(...)
 
in applications app1 and app2 i have:
 
db = DAL('sqlite://../../shared/databases/storage.sqlite')
session.connect(request, response, db = db, masterapp = 'shared')
(...)
auth.define_tables(migrate = False)
(...)
 
folders app1/databases and app2/databases do not have any databases,
which means they use database from shared. Did that part right :)
 
The funny part starts here:
If I register new user via application shared, I cannot login from
app1 nor app2, only from app shared. Once I log in application
shared, I'm logged in all three applications.
If I register new user via applicaton app1, i cannot login from
shared, but can from both app1 and app2. After loggind, the
 same
situation as above, I'm logged in all three applications.
 
I guess i won't have any headaches with this one, because application
shared will be 'hidden' and users will not register accounts using
registration form on that app. It should be enough, but that does not
solve the problem. I created another application app3, and managed
to login to all accounts which I made from app1 or app2. Could
 not
login to accounts from shared (just wanted to make sure I got it
right).
 
I don't know if this is a web2py bug or a feature, and if it is a
feature, why  howto fix (if possible).
 
p.s. I used applications generated by framework, i edited only the
lines mentioned above.
 
 



[web2py] Re: Problem when trying to upload a file in web2py 1.90.4

2010-12-22 Thread Charis
it worked. Thank you very much.

On Dec 23, 12:15 am, mdipierro mdipie...@cs.depaul.edu wrote:
 The problem is thet you have an upload field is a form that is not
 connected to a database (because you are using a factory). web2py does
 not know what to do with the file. You need to specify the
 uploadfolder.

 uf=os.path.join(request.folder,'uploads')
 form =
 SQLFORM.factory(Field('email','string'),Field('data','upload',uploadfolder= 
 uf))

 Massimo

 On Dec 22, 4:49 pm, Charis charalambos.chrysosto...@gmail.com wrote:







  I define the db using:

  db = DAL('sqlite://db.db')

  db.define_table('database',
                  SQLField('email','string'),
                  SQLField('data','upload')
                  )

  I create a form using

  form = SQLFORM.factory(db.database.email,db.database.data)

  The form appears correctly but when i try to submit a file i get the
  following error: (the problem seems to be in dal.py at line 4141 where
  path == '' or path.endswith('/') )

  File /home/charis/Desktop/test/gluon/dal.py in store at line 4141
              if path:
                  pass
              elif self.uploadfolder:
                  path = self.uploadfolder
              else:
                  path = os.path.join(self.db._adapter.folder, '..',
  'uploads')

              if self.uploadseparate:
                  path = os.path.join(path,%s.%s % (self._tablename,
  self.name),uuid_key[:2])
              if not os.path.exists(path):
                  os.makedirs(path)

  File /usr/lib/python2.6/posixpath.py in join at line 67
      will be discarded.
      path = a
      for b in p:
          if b.startswith('/'):
              path = b
          elif path == '' or path.endswith('/'):

              path +=  b
          else:
              path += '/' + b
      return path

  On Dec 20, 2:03 am, mdipierro mdipie...@cs.depaul.edu wrote:

   I cannot reproduce the problem. What db?

   On Dec 19, 6:39 pm, Charis charalambos.chrysosto...@gmail.com wrote:

I have the following error message when i try to upload a file in
web2py 1.90.4. This feature was working fine for me with the previews
versions.

Traceback (most recent call last):
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/restricted.py,
line 188, in restricted
    exec ccode in environment
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
controllers/default.py, line 150, in module
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/globals.py,
line 95, in lambda
    self._caller = lambda f: f()
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
controllers/default.py, line 15, in index
    if form.accepts(request.vars, session):
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/sqlhtml.py,
line 1104, in accepts
    newfilename = field.store(source_file, original_filename)
  File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/dal.py, line
4132, in store
    path = os.path.join(self.db._adapter.folder, '..', 'uploads')
  File /usr/lib/python2.6/posixpath.py, line 67, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'


Re: [web2py] Re: Problem when trying to upload a file in web2py 1.90.4

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 4:15 PM, mdipierro wrote:
 
 The problem is thet you have an upload field is a form that is not
 connected to a database (because you are using a factory). web2py does
 not know what to do with the file. You need to specify the
 uploadfolder.

It might not hurt to check this explicitly and fail in a more helpful manner.


 
 uf=os.path.join(request.folder,'uploads')
 form =
 SQLFORM.factory(Field('email','string'),Field('data','upload',uploadfolder=uf))
 
 Massimo
 
 On Dec 22, 4:49 pm, Charis charalambos.chrysosto...@gmail.com wrote:
 I define the db using:
 
 db = DAL('sqlite://db.db')
 
 db.define_table('database',
 SQLField('email','string'),
 SQLField('data','upload')
 )
 
 I create a form using
 
 form = SQLFORM.factory(db.database.email,db.database.data)
 
 The form appears correctly but when i try to submit a file i get the
 following error: (the problem seems to be in dal.py at line 4141 where
 path == '' or path.endswith('/') )
 
 File /home/charis/Desktop/test/gluon/dal.py in store at line 4141
 if path:
 pass
 elif self.uploadfolder:
 path = self.uploadfolder
 else:
 path = os.path.join(self.db._adapter.folder, '..',
 'uploads')
 
 if self.uploadseparate:
 path = os.path.join(path,%s.%s % (self._tablename,
 self.name),uuid_key[:2])
 if not os.path.exists(path):
 os.makedirs(path)
 
 File /usr/lib/python2.6/posixpath.py in join at line 67
 will be discarded.
 path = a
 for b in p:
 if b.startswith('/'):
 path = b
 elif path == '' or path.endswith('/'):
 
 path +=  b
 else:
 path += '/' + b
 return path
 
 On Dec 20, 2:03 am, mdipierro mdipie...@cs.depaul.edu wrote:
 
 I cannot reproduce the problem. What db?
 
 On Dec 19, 6:39 pm, Charis charalambos.chrysosto...@gmail.com wrote:
 
 I have the following error message when i try to upload a file in
 web2py 1.90.4. This feature was working fine for me with the previews
 versions.
 
 Traceback (most recent call last):
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/restricted.py,
 line 188, in restricted
 exec ccode in environment
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
 controllers/default.py, line 150, in module
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/globals.py,
 line 95, in lambda
 self._caller = lambda f: f()
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/applications/init/
 controllers/default.py, line 15, in index
 if form.accepts(request.vars, session):
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/sqlhtml.py,
 line 1104, in accepts
 newfilename = field.store(source_file, original_filename)
   File /home/charis/Desktop/Dropbox/BioSP_v0.6/gluon/dal.py, line
 4132, in store
 path = os.path.join(self.db._adapter.folder, '..', 'uploads')
   File /usr/lib/python2.6/posixpath.py, line 67, in join
 elif path == '' or path.endswith('/'):
 AttributeError: 'NoneType' object has no attribute 'endswith'
 
 




[web2py] DotCloud is Heroku with more options

2010-12-22 Thread pbreit
Could be an interesting deployment option for 
Web2py: http://www.dotcloud.com/

[web2py] Re: database query

2010-12-22 Thread czamb
Massimo, thanks for the quick reply, seems to work :)
Regards
 czamb

On 22 Dez., 02:21, mdipierro mdipie...@cs.depaul.edu wrote:
 If you have joins, I would do this:

 movies_with_activeTag=db(db.movies.id.belongs(db(db.link.tagID==id_of_activeTag)._select(db.link.movieID,groupby=db.link.movieID,orderby=db.link.movieID))).select()

 On Dec 21, 7:00 pm, czamb grossep...@googlemail.com wrote:

  This should be an easy one, but I can't figure it out. I am using the
  tagging implementation from plugin_wiki: Two tables (tag and link)
  store the info about tags on records in a third table (e.g. movies).
  db.tag has Fields id and name=str
  db.link has fields id, tagID=int and movieID=int

  Now if a user clicks on a tag in the tag-cloud, what is a good query
  to find all movies with that tag?
  Can I do that with standard queries and .select() or do I need to use
  executesql?

  movies_with_activeTag=db((db.link.tagID==id_of_activeTag)(db.movies.id==db.link.movieID)).select()

  was something I came up with (I have about zero experience with the
  query syntax) but it gives strange recursion errors:
  ...
  File c:\\web2py\gluon\dal.py, line 3456, in __allocate
      raise RuntimeError, Using a recursive select but encountered a
  broken reference
  RuntimeError: Using a recursive select but encountered a broken
  reference

  If I need the SQL execution, how can I convert its output to a rows
  object?
  sqlite is the database
  Thanks in advance any help is welcome.
  Regards
    czamb




[web2py] staging setup with apache2 and directory directive?

2010-12-22 Thread czamb
Hello web2py universe,

does anybody have experience with a staging setup through apache
mod_auth_basic or mod_auth_digest?
I want to have some beta testers run a prototype. After entering
username and password they should be able to use the app just as
normal with internal authentication and so on.

The setup-web2py-ubuntu.sh deploy script worked like a charm :))
Then I filled in the empty /etc/apache2/httpd.conf

Directory /home/www-data/web2py
AuthType Basic
AuthName Restricted Files
AuthUserFile /etc/apache2/passwords
Require user tester1 tester2
/Directory

and the passwords file is
tester1:pwd1
tester2:pwd2

Now I get a dialog for user and password.
But after entering the credentials apache keeps asking again and again
for them.
Any ideas what I'm missing?

Thank you.
Regards
 czamb


[web2py] Re: The stability of web2py releases

2010-12-22 Thread VP
In my humble opinion, the word Enterprise demands a more systematic
approach to dealing with this issue.  I think the simplest way is
perhaps has a numbering scheme that is understood by everyone.  For
example, increment the third number (e.g. from 1.90.2 to 1.90.3) only
for bug fixes, and increment the second number (e.g. from 1.90.3 to
1.91.0) for major releases or addition of new features.


[web2py] Re: Great summary of web2py

2010-12-22 Thread VP
I've supported web2py for a long time.  But I think it's time to
rethink about PR. Frankly, I think this Flask/Django business is a
distraction.  I think Massimo should completely ignore and do not say
anything about Flask or Django.


[web2py] Re: Encountering problem with a computer field

2010-12-22 Thread Magnitus
Ah, ok.

So basically, because the computed field is stored and updated during
writes, it will get re-computed at every input (even if its
dependencies are not changed) and expects its dependencies to be
present in the input (ie, won't read the fields in the DB for missing
values).

I guess I should have figured it out that it would be pretty hard for
the Framework to extract the dependencies from the lambda expression
(well, catching the exception does work, though you are right that it
will leave possible syntax errors uncatched... tough cookie there).

In that case, I guess I'll look at virtual fields (where the value is
computed during extraction) for my needs instead.

Thanks for the insight.

On Dec 22, 7:04 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 The problem is that you have compute attribute set at table definition
 so web2py tries to use it at every insert and every update. Even if in
 your update you is has no knowledge of the previous Alias_ordinal
 because you only updating Number_of_posts.

 There are two solutions... set db.table.field.compute=... only in the
 actions that need it.

 I can add a try except so that web2py does not tries to compute fields
 when there is not enough information. The downside is that a typo will
 result in a silent failure to compute. Perhaps we should do this
 anyway.

 Massimo

 On Dec 22, 4:56 pm, Magnitus fbunny2...@hotmail.com wrote:

  Hi,

  btw, I upgraded from 1.87 to 1.91 to see if the problem would get
  resolved and 1.91 is loading my pages significantly faster. Also, the
  revised version of the pdf manual is greatly superior to the original.
  Thank you for that.

  So, I tried to get fancy and use a computer field in my model and now
  I'm getting an error (serves me right for trying to be fancy).

  Either I'm doing something wrong or there is a bug. If I'm doing
  something wrong, I'd like to know.

  the relevant entry in model is as follow:

  Forums_db.define_table('Forum_poster',
      Field('Alias', 'string', length=128, required=True),
      Field('Alias_ordinal', 'integer', default=1),
      Field('Alias_apparent', compute=lambda r: (r['Alias'] if
  r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
  +']')),
      Field('Email', length=128, required=True),
      Field('Number_of_posts', 'integer', default=0),
      Field('Banned', 'boolean', default=False))

  Whenever I try to write in the DB (insert or update), I get a key
  error on 'Alias_ordinal'.

  The relevant parts of the error log are as follow:

  Last entry pertaining to my code:

    File applications\Ascent\modules\Forum_tools.py, line 140, in
  Submit_thread

  DB(DB.Forum_poster.id==Poster['ID']).update(Number_of_posts=Poster['Number_of_posts']
  +1)

  Last entry pertaining to gluon internals:

    File G:/Game_0_42/Code/web2py/applications/Ascent/models/
  Forums.py, line 21, in lambda
      Field('Alias_apparent', compute=lambda r: (r['Alias'] if
  r['Alias_ordinal']==1 else r['Alias']+'['+str(r['Alias_ordinal'])
  +']')),
    File G:\Game_42\Code\web2py\gluon\dal.py, line 3054, in
  __getitem__
      return dict.__getitem__(self, key)
  KeyError: 'Alias_ordinal'

  Some additional debug info from the log:

  Function argument list

  (self=Row {'Number_of_posts': 1}, key='Alias_ordinal')
  Code listing

      def __getitem__(self, key):
          key=str(key)
          if key in self.get('_extra',{}):
              return self._extra[key]
  return dict.__getitem__(self, key)

      def __call__(self,key):
          key=str(key)
          if key in self.get('_extra',{}):

  Variables
  self    Row {'Number_of_posts': 1}
  dict.__getitem__        method '__getitem__' of 'dict' objects
  builtindict     type 'dict'
  key     'Alias_ordinal'

  Any help in diagnosing the problem would be greatly appreciated.
  Thanks.




[web2py] Re: The stability of web2py releases

2010-12-22 Thread Luther Goh Lu Feng
I think the suggested versioning works great

What I suggest is perhaps label the latest release as the testing
branch eg 1.91 is the testing branch. 1.90 will be the stable branch.
These will of course increment by 0.01 in the next web2py release.

In the admin panel, have the option for the user to upgrade/downgrade
to/from the testing/stable branches.

On Dec 23, 11:07 am, VP vtp2...@gmail.com wrote:
 In my humble opinion, the word Enterprise demands a more systematic
 approach to dealing with this issue.  I think the simplest way is
 perhaps has a numbering scheme that is understood by everyone.  For
 example, increment the third number (e.g. from 1.90.2 to 1.90.3) only
 for bug fixes, and increment the second number (e.g. from 1.90.3 to
 1.91.0) for major releases or addition of new features.


[web2py] Re: The stability of web2py releases

2010-12-22 Thread Luther Goh Lu Feng
To clarify, what I am saying is, no change to current release system,
except to label stable and testing branches. It's a little like the
branches of Debian Linux 
http://wiki.linuxquestions.org/wiki/Debian#Stable.2C_Testing.2C_Unstable.2C_and_Experimental

web2py probably don't need so many branches.

On Dec 23, 11:52 am, Luther Goh Lu Feng elf...@yahoo.com wrote:
 I think the suggested versioning works great

 What I suggest is perhaps label the latest release as the testing
 branch eg 1.91 is the testing branch. 1.90 will be the stable branch.
 These will of course increment by 0.01 in the next web2py release.

 In the admin panel, have the option for the user to upgrade/downgrade
 to/from the testing/stable branches.

 On Dec 23, 11:07 am, VP vtp2...@gmail.com wrote:







  In my humble opinion, the word Enterprise demands a more systematic
  approach to dealing with this issue.  I think the simplest way is
  perhaps has a numbering scheme that is understood by everyone.  For
  example, increment the third number (e.g. from 1.90.2 to 1.90.3) only
  for bug fixes, and increment the second number (e.g. from 1.90.3 to
  1.91.0) for major releases or addition of new features.


Re: [web2py] Re: The stability of web2py releases

2010-12-22 Thread Jonathan Lundell
On Dec 22, 2010, at 8:01 PM, Luther Goh Lu Feng wrote:
 
 To clarify, what I am saying is, no change to current release system,
 except to label stable and testing branches. It's a little like the
 branches of Debian Linux 
 http://wiki.linuxquestions.org/wiki/Debian#Stable.2C_Testing.2C_Unstable.2C_and_Experimental

It requires some kind of change, since we'd need a branch for the release and 
the trunk for continued development. 

A simple mechanism is to have the trunk (unstable) be 1.90.0, 1.91.0, 1.92.0, 
...

From each of those, we branch from (for example) 1.91.0 to 1.91.1, 1.91.2, ... 
for bug fixes only: stable.

Not all of the stable branches would be maintained indefinitely.

The mechanism is simple, but patches to the trunk would have to be 
single-subject, and identified a little better as to content.

 
 web2py probably don't need so many branches.
 
 On Dec 23, 11:52 am, Luther Goh Lu Feng elf...@yahoo.com wrote:
 I think the suggested versioning works great
 
 What I suggest is perhaps label the latest release as the testing
 branch eg 1.91 is the testing branch. 1.90 will be the stable branch.
 These will of course increment by 0.01 in the next web2py release.
 
 In the admin panel, have the option for the user to upgrade/downgrade
 to/from the testing/stable branches.
 
 On Dec 23, 11:07 am, VP vtp2...@gmail.com wrote:
 
 
 
 
 
 
 
 In my humble opinion, the word Enterprise demands a more systematic
 approach to dealing with this issue.  I think the simplest way is
 perhaps has a numbering scheme that is understood by everyone.  For
 example, increment the third number (e.g. from 1.90.2 to 1.90.3) only
 for bug fixes, and increment the second number (e.g. from 1.90.3 to
 1.91.0) for major releases or addition of new features.




[web2py] syntax checker won't let me save this

2010-12-22 Thread rāma
I tried to construct a validator:

db.sender.keywords.requires = IS_IN_DB(db( db.auth_user.id=user_id ),
db.userkeywords.keyword)

I was able to do this in previous versions.

Please help.


Re: [web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-12-22 Thread pbreit
I added instructions for SSL:
http://web2pyslices.com/main/slices/take_slice/110

Seems to work OK.


Re: [web2py] Re: Sharing sessions and authentication

2010-12-22 Thread ron_m
Would this key have to be the same in all applications in your case?

auth.settings.hmac_key = 'sha512:63f0a5e7-e395-4a28-8488-cf072a0464b6'   # 
before define_tables()

not the same as this particular one but consistent across all of the 
applications you have since you are sharing your auth_user table and this 
key is used to encrypt the password field of the table.

This line is in the original models/db.py file of the application.

Ron


Re: [web2py] Re: Sharing sessions and authentication

2010-12-22 Thread ron_m
Would this key have to be the same in all applications? from my last post 
doesn't read correctly.

I mean the same hmac_key in your set of shared applications.

Sorry the deleted posts showed up as duplicates, the web app was showing 
error #316 post failed and saying try again but then they were all there.


[web2py] Re: Great summary of web2py

2010-12-22 Thread mdipierro
+1

I think we should go after PHP, ASP, JSP

On Dec 22, 9:16 pm, VP vtp2...@gmail.com wrote:
 I've supported web2py for a long time.  But I think it's time to
 rethink about PR. Frankly, I think this Flask/Django business is a
 distraction.  I think Massimo should completely ignore and do not say
 anything about Flask or Django.


  1   2   >