[web2py] Re: Congratulations to this mailing list

2011-04-04 Thread Mengu
it's because they beat us on the number of irc users. :)

as of april 4, 2011, 10:33 am gmt +2, #django has 289 users,
#rubyonrails has 498 users, #web2py has 16 users. we are definitely
more than that. just come to irc, especially yourself massimo. of
course we cannot underestimate the number of posts in all 3 mailing
lists. it's not a secret that web2py mailing list is the most active
one among the python web frameworks. pylons, pyramid, turbogears,
web.py, etc have very very low activity.

On Apr 4, 3:32 am, Esteban Ordano  wrote:
> Congratulations!
>
> I'm really fond of the web2py framework. In fact, after having used both
> web2py and django, I am very biased towards web2py. I think that you simply
> *get* it, and you did a excellent job, and you keep on doing great work.
>
> But I think that this has to be taken with extreme caution: What does this
> *really* say about web2py?
>
> Most of all, beware: I think that a very big pro for django is that in
> stackoverflow.com there are 16k questions on Django, so this may mean that a
> lot of questions get answered there instead of being asked in the django
> mailing list.
>
> Regards,
> Esteban
>
> On Sun, Apr 3, 2011 at 9:16 PM, Massimo Di Pierro <
>
>
>
>
>
>
>
> massimo.dipie...@gmail.com> wrote:
> > Here is another plot adding Ruby on Rails data (rubyonrails-talk)
>
> >http://i.imgur.com/sPLzH.png
>
> > we passed them too as messages/month since Dec 2010.
> > According to this (http://rubyonrails.org/community) rubyonrails-talk
> > is the main Rails list for users.
>
> > Massimo
>
> > On Apr 3, 7:08 pm, Anthony  wrote:
> > > I don't have exact numbers, but over the past 11 months, I think the
> > web2py
> > > Google Group membership has grown by over 50%. By contrast, it appears
> > the
> > > Django Google Group membership has grown by only about 10%-15%. I guess
> > > there's a reason there were three April Fools jokes on Reddit targeting
> > > web2py. :)
>
> > > On Sunday, April 3, 2011 7:53:35 PM UTC-4, Massimo Di Pierro wrote:
> > > > I mined some data from:
>
> > > >http://groups.google.com/group/web2py/about
> > > >http://groups.google.com/group/django-users/about
>
> > > > This web2py users group had 56,283 messages posted since 1/1/2009. The
> > > > Django-users list had 51,119 over the same time period.
>
> > > > Here is a plot showing the messages/month in the two users groups
> > > >http://i.imgur.com/GHcce.png
> > > > As you can see the surpass is significative and consistent since Oct
> > > > 2009.
>
> > > > Now we know why some people are upset about web2py ;-)
>
> > > > Congratulations to all of you!
>
> > > > Massimo


[web2py] Re: eliminate 'column-header' titles from query response?

2011-04-04 Thread james c.
HI Anthony,

Thanks for the follow up and comments. I found a simple solution,
described just below. I consider my problem solved. However, you asked
for more information which is also below. If you really wish to take
this on to investigate further for a possible bug report - let me know
and I'll send you a stripped down app to experiment with.

 The short summary, my solution uses the dictionary method
iteritems(), maybe not so nice to look at but it works. I think the
problems with the more direct solutions are a result of that among
python254, pythno271,  active python261, and Web2Py there are
differences in what python returns in some dictionary methods, and the
operators [c] and [x][c]. Most of the time when Web2py performed some
conversion from dictionary to list, it was not possible to access the
results as a list, using [0], or access it as a dictionary with a key,
or access it as a string. I did not notice this happening when working
similar test examples with similar python code just running in a
console.

thanks, james c.



Late Friday, while grasping at things like string output conversions
as possible solutions, I found  alternate dictionary iterative methods
- after which I had a solution working in about two minutes. It just
worked. here it is:

cpp=db(db.customer_names.id==name_index).select().as_dict()
for kk, vv in cpp.iteritems():
  cp1 = kk
  cpp = vv['name']

I consider this solving my problem. However, I did continue trying to
get something, similar to what you suggest working.

db(db.customer_names.id==names_index).select('name').first().name

I could get something similar to this running in the console. My
web2py is using the default Python254. With Python254, adding first()
or .name, results in a compile or syntax error. The least common parts
of this code that I got to work is:

pcc=db(db.customer_names.id==names_index).select('name')

this is returned through to the view as  return
dict(display_name=pcc...)  and in the view {{=display_name}}. In this
case I believe the functions are returning html because the resulting
web page output is formated such as:

NAME
--
 The Big

Then I tried:
===
cname=db(db.customer_names.id==names_index).select('name').first()
crashes with

ERROR SNAPSHOT
('xml')

===

cname=db(db.customer_names.id==names_index).select().first()

Type 'exceptions.KeyError'>('xml')

===

cname=db(db.customer_names.id==name_index).select('name').first()

('xml')

===

I then tried a lot of variations on

cname=(db.(db.customer_names.id==name_index).select()).as_dict()
['name_index']
if the above worked, it would not be the answer - it would only be the
second dict()

also using  .views()  and .items()   views()  transforms the
dictionary to a nice format:
 [{'id': 12, 'name': 'WATER COM'}]  which in the console a solution
quickly followed.
However, Web2py it was not possible to address this either as a list,
dictionary or string.

 I believe these problems are related to differences among Python
2.5.4, Python 2.7.1, Active Python 2.6.x, and Web2Py in how they
handle Python dictionary methods such as values() and itmes(), as well
as the operators [] and [][].

Both Python 2.5.4 and 2.7.1's implementation of .values() does not
match the documentation. a.values() is supposed to return only just
the values in the dictionary as a list. The Python 25 and Python27
implementation appear to just embed the dictionary between to square
brackets "[']" and change the "type" to list. Active state implements
exactly what is described, it returns just a list of the values. I
could get code working (in a manner similar to what you suggest) with
the three versions of python in console to retrieve specific
dictionary items, but in Web2py the system seems to not be recognizing
these returned items as lists or as dictionaries.

db.define_table('customer_names',


Field('name'))



db.define_table('customer_accounts',


Field('possible'))





db.define_table('customer',


Field('symbol', requires=IS_NOT_EMPTY()),


Field('name', db.customer_names),


Field('account', db.customer_accounts))


db.customer.name.requires = IS_IN_DB(db,db.customer_names.id, '%
(name)s')


db.customer.account.requires = IS_IN_DB(db,db.customer_accounts.id, '%
(possible)s')


On Apr 1, 9:09 pm, Anthony  wrote:
> Are you saying that 
> db(db.customer_names.id==names.index).select('name').first().name does
> not return just the name? Can you show your model code?
>
> Also, if you use as_list, you get a list of dictionaries (one dictionary per
> Row in the Rows object). If there is only one Row, then there is only one
> dictionary in the list, and therefore the maximum index of the list will be
> 0. If you try current_customer_name[2], it's looking for the third
> dictionary in the list (i.e., the third Row), which of course does not
> exist. The way you have defined current_

[web2py] main menu z-index

2011-04-04 Thread Manuele Pesenti

Hi *
I have inserted a map inside the index page of my application but I 
realized that the map overlap all scrolls of the main menu in default 
web2py theeme. I've tyied to set style="z-index:-10;" for the div of my 
map but without results. Can you tell me how to resolve it?


Thenkyou very mutch

Manuele


[web2py] SyntaxError: setting key 'change_password_onvalidation' does not exist

2011-04-04 Thread Ab...
Hello,

In an application that allows password column in auth_user table to be
null as it uses facebook login also, I have a change password auth
form where I'd like to force validation that new password can not be
blank..

Based on http://web2py.com/book/default/chapter/08#Authentication a
few lines below "Settings and Messages" heading, I am trying to do :

auth.settings.change_password_onvalidation = lambda form:
passwordvalidation(form))
def passwordvalidation(form):
print "do validation"

But I am getting an error saying : raise SyntaxError, 'setting key \'%s
\' does not exist' % key
SyntaxError: setting key 'change_password_onvalidation' does not exist

Any pointers?


[web2py] Re: Congratulations to this mailing list

2011-04-04 Thread selecta
ah i was just about to complain that the main page still links to a
strange irc channel, but that finally changed
i guess this is one of the reasons why there are so few people in the
irc channel, it was just not linked properly

On Apr 4, 9:38 am, Mengu  wrote:
> it's because they beat us on the number of irc users. :)
>
> as of april 4, 2011, 10:33 am gmt +2, #django has 289 users,
> #rubyonrails has 498 users, #web2py has 16 users. we are definitely
> more than that. just come to irc, especially yourself massimo. of
> course we cannot underestimate the number of posts in all 3 mailing
> lists. it's not a secret that web2py mailing list is the most active
> one among the python web frameworks. pylons, pyramid, turbogears,
> web.py, etc have very very low activity.
>
> On Apr 4, 3:32 am, Esteban Ordano  wrote:
>
>
>
> > Congratulations!
>
> > I'm really fond of the web2py framework. In fact, after having used both
> > web2py and django, I am very biased towards web2py. I think that you simply
> > *get* it, and you did a excellent job, and you keep on doing great work.
>
> > But I think that this has to be taken with extreme caution: What does this
> > *really* say about web2py?
>
> > Most of all, beware: I think that a very big pro for django is that in
> > stackoverflow.com there are 16k questions on Django, so this may mean that a
> > lot of questions get answered there instead of being asked in the django
> > mailing list.
>
> > Regards,
> > Esteban
>
> > On Sun, Apr 3, 2011 at 9:16 PM, Massimo Di Pierro <
>
> > massimo.dipie...@gmail.com> wrote:
> > > Here is another plot adding Ruby on Rails data (rubyonrails-talk)
>
> > >http://i.imgur.com/sPLzH.png
>
> > > we passed them too as messages/month since Dec 2010.
> > > According to this (http://rubyonrails.org/community) rubyonrails-talk
> > > is the main Rails list for users.
>
> > > Massimo
>
> > > On Apr 3, 7:08 pm, Anthony  wrote:
> > > > I don't have exact numbers, but over the past 11 months, I think the
> > > web2py
> > > > Google Group membership has grown by over 50%. By contrast, it appears
> > > the
> > > > Django Google Group membership has grown by only about 10%-15%. I guess
> > > > there's a reason there were three April Fools jokes on Reddit targeting
> > > > web2py. :)
>
> > > > On Sunday, April 3, 2011 7:53:35 PM UTC-4, Massimo Di Pierro wrote:
> > > > > I mined some data from:
>
> > > > >http://groups.google.com/group/web2py/about
> > > > >http://groups.google.com/group/django-users/about
>
> > > > > This web2py users group had 56,283 messages posted since 1/1/2009. The
> > > > > Django-users list had 51,119 over the same time period.
>
> > > > > Here is a plot showing the messages/month in the two users groups
> > > > >http://i.imgur.com/GHcce.png
> > > > > As you can see the surpass is significative and consistent since Oct
> > > > > 2009.
>
> > > > > Now we know why some people are upset about web2py ;-)
>
> > > > > Congratulations to all of you!
>
> > > > > Massimo


Re: [web2py] Re: MongoDB and Web2Py

2011-04-04 Thread Ahmed Bani



I will test it for my new application: x2py = a web2py-powered web-based email 
client.

Yet, another web-based email client! 








[web2py] Re: Funny behavior with referenced Field display if writable=False

2011-04-04 Thread szimszon
Can I help with something?

On márc. 30, 08:55, szimszon  wrote:
> Any progress / comment?
>
> On márc. 27, 22:04, szimszon  wrote:
>
>
>
>
>
>
>
> > Hi!
>
> > I use Version 1.94.6 (2011-03-27 18:20:38).
>
> > I have in db:
> > -
> > db.define_table( 'mail_domain',
> >                                                         Field( 
> > 'domainname', 'string',
> >                                                                             
> >     label = 'Domain név',
> >                                                                             
> >     requires = IS_NOT_EMPTY()
> >                                                                             
> >     ),
> >                                                         signature,
> >                                                         migrate = 
> > settings.migrate,
> >                                                         )
> > db.define_table( 'mail_domain_alias',
> >                                                         Field( 
> > 'mail_domain_id', db.mail_domain,
> >                                                                             
> >     label = 'Domain név',
> >                                                                             
> >     requires = IS_IN_DB( db, db.mail_domain.id, '%
> > (domainname)s' ),
> >                                                                             
> >     *writable = False,*
> >                                                                             
> >     ),
> >                                                         Field( 'alias', 
> > 'string',
> >                                                                             
> >     label = 'Aliasz',
> >                                                                             
> >     requires = IS_NOT_EMPTY()
> >                                                                             
> >     ),
> >                                                         signature,
> >                                                         migrate = 
> > settings.migrate,
> >                                                         )
> > --
>
> > controller:
>
> > 
> > def domain():
> >         form = crud.update( db.mail_domain, request.args( 0 ) )
> >         return dict( form = form )
> > def domainalias():
> >         db.mail_domain_alias.mail_domain_id.default = session.domainname_id
> >         form = crud.update( db.mail_domain_alias, request.args( 0 ) )
> >         return dict( form = form )
> > def setdomain():
> >         session.domainname_id = request.args( 0 )
> >         session.domainname = db( db.mail_domain.id ==
> > session.domainname_id ).select( db.mail_domain.domainname 
> > ).first().domainname
> >         redirect( URL( 'default', 'index' ) )
> > -
>
> > If the session.domainname_id is set to a valid mail_domain record ID,
> > than the crud in domainalias shows the reference field as number and
> > not as domainname string.
>
> > But if I remove the writable=False in mail_domain_alias table's
> > mail_domain_id field than I have a dropdown menu with the right record
> > selected as domainname and not as ID number.
>
> > I think the right behavior would be if I set the writable = True that
> > I would see the right record not as ID but as %(domainname)s

Re: [web2py] main menu z-index

2011-04-04 Thread Martín Mulone
can you show us a screenshot of the problem and the code where do you put
the map?

2011/4/4 Manuele Pesenti 

> Hi *
> I have inserted a map inside the index page of my application but I
> realized that the map overlap all scrolls of the main menu in default web2py
> theeme. I've tyied to set style="z-index:-10;" for the div of my map but
> without results. Can you tell me how to resolve it?
>
> Thenkyou very mutch
>
>Manuele
>



-- 
My blog: http://martin.tecnodoc.com.ar
Expert4Solution: http://www.experts4solutions.com/e4s/default/expert/6
http://www.cvstash.com/profile/Xzi5bWCdD


Re: [web2py] New b2b site using web2py

2011-04-04 Thread Martín Mulone
Congrats, looks very nice.

2011/4/4 JimK 

> Hello Everyone!
>
> I've been working on a business for some time and have finally
> launched it!  The web server for the main app and CAS are running on
> appengine using the web2py framework.  Please check it out and let me
> know what you think.  The url is www.qakit.com and you can register
> for a free 2-person account to try it out.
>
> QAKit is the Jira Studio (http://www.atlassian.com/hosted/studio/) for
> early-stage startups; a fully configured and integrated suite of tools
> for agile development.  The suite includes Bugzilla, Testopia,
> Dokuwiki and Generate Data.
>
> Cheers!
>
> Jim Kellas




-- 
My blog: http://martin.tecnodoc.com.ar
Expert4Solution: http://www.experts4solutions.com/e4s/default/expert/6
http://www.cvstash.com/profile/Xzi5bWCdD


[web2py] Re: Congratulations to this mailing list

2011-04-04 Thread Mengu
also people are not couraged to join the irc room. that's one of the
reasons.

On Apr 4, 12:26 pm, selecta  wrote:
> ah i was just about to complain that the main page still links to a
> strange irc channel, but that finally changed
> i guess this is one of the reasons why there are so few people in the
> irc channel, it was just not linked properly
>
> On Apr 4, 9:38 am, Mengu  wrote:
>
>
>
>
>
>
>
> > it's because they beat us on the number of irc users. :)
>
> > as of april 4, 2011, 10:33 am gmt +2, #django has 289 users,
> > #rubyonrails has 498 users, #web2py has 16 users. we are definitely
> > more than that. just come to irc, especially yourself massimo. of
> > course we cannot underestimate the number of posts in all 3 mailing
> > lists. it's not a secret that web2py mailing list is the most active
> > one among the python web frameworks. pylons, pyramid, turbogears,
> > web.py, etc have very very low activity.
>
> > On Apr 4, 3:32 am, Esteban Ordano  wrote:
>
> > > Congratulations!
>
> > > I'm really fond of the web2py framework. In fact, after having used both
> > > web2py and django, I am very biased towards web2py. I think that you 
> > > simply
> > > *get* it, and you did a excellent job, and you keep on doing great work.
>
> > > But I think that this has to be taken with extreme caution: What does this
> > > *really* say about web2py?
>
> > > Most of all, beware: I think that a very big pro for django is that in
> > > stackoverflow.com there are 16k questions on Django, so this may mean 
> > > that a
> > > lot of questions get answered there instead of being asked in the django
> > > mailing list.
>
> > > Regards,
> > > Esteban
>
> > > On Sun, Apr 3, 2011 at 9:16 PM, Massimo Di Pierro <
>
> > > massimo.dipie...@gmail.com> wrote:
> > > > Here is another plot adding Ruby on Rails data (rubyonrails-talk)
>
> > > >http://i.imgur.com/sPLzH.png
>
> > > > we passed them too as messages/month since Dec 2010.
> > > > According to this (http://rubyonrails.org/community) rubyonrails-talk
> > > > is the main Rails list for users.
>
> > > > Massimo
>
> > > > On Apr 3, 7:08 pm, Anthony  wrote:
> > > > > I don't have exact numbers, but over the past 11 months, I think the
> > > > web2py
> > > > > Google Group membership has grown by over 50%. By contrast, it appears
> > > > the
> > > > > Django Google Group membership has grown by only about 10%-15%. I 
> > > > > guess
> > > > > there's a reason there were three April Fools jokes on Reddit 
> > > > > targeting
> > > > > web2py. :)
>
> > > > > On Sunday, April 3, 2011 7:53:35 PM UTC-4, Massimo Di Pierro wrote:
> > > > > > I mined some data from:
>
> > > > > >http://groups.google.com/group/web2py/about
> > > > > >http://groups.google.com/group/django-users/about
>
> > > > > > This web2py users group had 56,283 messages posted since 1/1/2009. 
> > > > > > The
> > > > > > Django-users list had 51,119 over the same time period.
>
> > > > > > Here is a plot showing the messages/month in the two users groups
> > > > > >http://i.imgur.com/GHcce.png
> > > > > > As you can see the surpass is significative and consistent since Oct
> > > > > > 2009.
>
> > > > > > Now we know why some people are upset about web2py ;-)
>
> > > > > > Congratulations to all of you!
>
> > > > > > Massimo


[web2py] Re: New b2b site using web2py

2011-04-04 Thread Mengu
hi,

i cannot access http://qakit.com in istanbul, turkey. are you using
google app engine?

On Apr 4, 8:12 am, JimK  wrote:
> Hello Everyone!
>
> I've been working on a business for some time and have finally
> launched it!  The web server for the main app and CAS are running on
> appengine using the web2py framework.  Please check it out and let me
> know what you think.  The url iswww.qakit.comand you can register
> for a free 2-person account to try it out.
>
> QAKit is the Jira Studio (http://www.atlassian.com/hosted/studio/) for
> early-stage startups; a fully configured and integrated suite of tools
> for agile development.  The suite includes Bugzilla, Testopia,
> Dokuwiki and Generate Data.
>
> Cheers!
>
> Jim Kellas


Re: [web2py] Re: Congratulations to this mailing list

2011-04-04 Thread Marin Pranjic
I can join if you need idlers :P

On Mon, Apr 4, 2011 at 12:46 PM, Mengu  wrote:

> also people are not couraged to join the irc room. that's one of the
> reasons.
>
> On Apr 4, 12:26 pm, selecta  wrote:
> > ah i was just about to complain that the main page still links to a
> > strange irc channel, but that finally changed
> > i guess this is one of the reasons why there are so few people in the
> > irc channel, it was just not linked properly
> >
> > On Apr 4, 9:38 am, Mengu  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > it's because they beat us on the number of irc users. :)
> >
> > > as of april 4, 2011, 10:33 am gmt +2, #django has 289 users,
> > > #rubyonrails has 498 users, #web2py has 16 users. we are definitely
> > > more than that. just come to irc, especially yourself massimo. of
> > > course we cannot underestimate the number of posts in all 3 mailing
> > > lists. it's not a secret that web2py mailing list is the most active
> > > one among the python web frameworks. pylons, pyramid, turbogears,
> > > web.py, etc have very very low activity.
> >
> > > On Apr 4, 3:32 am, Esteban Ordano  wrote:
> >
> > > > Congratulations!
> >
> > > > I'm really fond of the web2py framework. In fact, after having used
> both
> > > > web2py and django, I am very biased towards web2py. I think that you
> simply
> > > > *get* it, and you did a excellent job, and you keep on doing great
> work.
> >
> > > > But I think that this has to be taken with extreme caution: What does
> this
> > > > *really* say about web2py?
> >
> > > > Most of all, beware: I think that a very big pro for django is that
> in
> > > > stackoverflow.com there are 16k questions on Django, so this may
> mean that a
> > > > lot of questions get answered there instead of being asked in the
> django
> > > > mailing list.
> >
> > > > Regards,
> > > > Esteban
> >
> > > > On Sun, Apr 3, 2011 at 9:16 PM, Massimo Di Pierro <
> >
> > > > massimo.dipie...@gmail.com> wrote:
> > > > > Here is another plot adding Ruby on Rails data (rubyonrails-talk)
> >
> > > > >http://i.imgur.com/sPLzH.png
> >
> > > > > we passed them too as messages/month since Dec 2010.
> > > > > According to this (http://rubyonrails.org/community)
> rubyonrails-talk
> > > > > is the main Rails list for users.
> >
> > > > > Massimo
> >
> > > > > On Apr 3, 7:08 pm, Anthony  wrote:
> > > > > > I don't have exact numbers, but over the past 11 months, I think
> the
> > > > > web2py
> > > > > > Google Group membership has grown by over 50%. By contrast, it
> appears
> > > > > the
> > > > > > Django Google Group membership has grown by only about 10%-15%. I
> guess
> > > > > > there's a reason there were three April Fools jokes on Reddit
> targeting
> > > > > > web2py. :)
> >
> > > > > > On Sunday, April 3, 2011 7:53:35 PM UTC-4, Massimo Di Pierro
> wrote:
> > > > > > > I mined some data from:
> >
> > > > > > >http://groups.google.com/group/web2py/about
> > > > > > >http://groups.google.com/group/django-users/about
> >
> > > > > > > This web2py users group had 56,283 messages posted since
> 1/1/2009. The
> > > > > > > Django-users list had 51,119 over the same time period.
> >
> > > > > > > Here is a plot showing the messages/month in the two users
> groups
> > > > > > >http://i.imgur.com/GHcce.png
> > > > > > > As you can see the surpass is significative and consistent
> since Oct
> > > > > > > 2009.
> >
> > > > > > > Now we know why some people are upset about web2py ;-)
> >
> > > > > > > Congratulations to all of you!
> >
> > > > > > > Massimo
>


Re: [web2py] Congratulations to this mailing list

2011-04-04 Thread Sebastian E. Ovide
On Mon, Apr 4, 2011 at 12:53 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I mined some data from:
>
> http://groups.google.com/group/web2py/about
> http://groups.google.com/group/django-users/about
>
> This web2py users group had 56,283 messages posted since 1/1/2009. The
> Django-users list had 51,119 over the same time period.
>
>
Very good it shows that web2py has more messages what does it really
mean apart than web2py mailing has more messages ?

Django has a really good documentation and perhaps people need to ask less ?

Django releases less versions and therefore people need to ask less
(web2py releases always a couple of "stable" versions after a "stable"
version has been released as it alwasy has few bugs)

Congratulations to all of you!
>
> Massimo


Congratulation to all of you ! great community !


-- 
Sebastian E. Ovide


Re: [web2py] url rewriting

2011-04-04 Thread Ahmed Sharkawy
*I use GAE and I use the app.yaml to solve this
but there is anther problem
I have more than one function in the file so I want to point to the specific
function

the code in app.yaml is
- url: /login
  script: applications\init\controllers\login.py

but if I have a script contain 2 functions how to point to one of them ?

Thanks for your patience and your ideas


*
On 3 April 2011 23:38, Jonathan Lundell  wrote:

> On Apr 3, 2011, at 2:22 PM, pbreit wrote:
> >
> > Oh right, cuz login is going to be /user/login ?
>
> Well, that too, but simply setting default_application (without any
> routing) will never suppress the application unless it's also suppressing
> the controller and function.
>
>


-- 
Ahmed Sharkawy


[web2py] Re: PostgreSQL Error "SELECT DISTINCT, ORDER BY expressions must appear in select list"

2011-04-04 Thread Ross Peoples
Showing us the model would help too, especially if you are connecting to a 
legacy database.

[web2py] Re: vote for Pycharm support for Web2py

2011-04-04 Thread Ross Peoples
I certainly did. We need a good IDE for web2py.

[web2py] Get last inserted field value

2011-04-04 Thread Neveen Adel
Hello,

I have the following table:

 db.define_table("member",
  SQLField("membership_id", "integer",notnull=True),
  SQLField("first_name", "string", notnull=True)
)

and i want  the membership id to be incremented automatically.


the way i used :

 every time i inserted it , i select the max membership_id and adding
one on its value as:

  result=db.executesql("select max(membership_id) from member")
  record=result[0]
  if record[0]:
next_membership_id = record[0]+1
  else:
 next_membership_id=1
   form.vars.membership_id=next_membership_id

But this solution allows duplicates??

could anyone tell me  what is the perfect solution?


Thanks in Advance





[web2py] Re: Get last inserted field value

2011-04-04 Thread Anthony
Your table already includes an 'id' field by default, which is an 
auto-increment integer field starting at 1. Why do you need a separate 
'membership_id' field? If it's a legacy database and you need the name of 
the 'id' field to be 'membership_id', you can simply define the field type 
as 'id' (see http://web2py.com/book/default/chapter/06?search=auto-increment
).
 
Also, you should use Field() instead of SQLField() -- they're both the same, 
but the latter has been deprecated in favor of the former.
 
Anthony

On Monday, April 4, 2011 8:35:00 AM UTC-4, Neveen Adel wrote:

> Hello, 
>
> I have the following table: 
>
>  db.define_table("member", 
>   SQLField("membership_id", "integer",notnull=True), 
>   SQLField("first_name", "string", notnull=True) 
> ) 
>
> and i want  the membership id to be incremented automatically. 
>
>
> the way i used : 
>
>  every time i inserted it , i select the max membership_id and adding 
> one on its value as: 
>
>   result=db.executesql("select max(membership_id) from member") 
>   record=result[0] 
>   if record[0]: 
> next_membership_id = record[0]+1 
>   else: 
>  next_membership_id=1 
>form.vars.membership_id=next_membership_id 
>
> But this solution allows duplicates?? 
>
> could anyone tell me  what is the perfect solution? 
>
>
> Thanks in Advance 
>
>
>
>

Re: [web2py] Re: Congratulations to this mailing list

2011-04-04 Thread Ross Peoples
I do have to say that the first time I went looking for help, I went to the 
IRC channel, that had 7 people in it, all of which were idle. The IRC 
channel would be great for answering quick questions for new users, and 
joining a mailing list does require a bit of commitment. For the more in 
depth questions, people should be directed towards the mailing list. A 
active IRC channel would encourage more collaboration between users and be 
more welcoming to new users with simple questions.

I think we should encourage more people to join and participate the IRC 
channel.


[web2py] Re: Get last inserted field value

2011-04-04 Thread Neveen Adel
Thanks Anthony for your reply.

The table already have an old data so i can't remove the column id or
change in the database structure.

Is there another solution in controller level not database level?

Thanks in Advance

On Apr 4, 2:54 pm, Anthony  wrote:
> Your table already includes an 'id' field by default, which is an
> auto-increment integer field starting at 1. Why do you need a separate
> 'membership_id' field? If it's a legacy database and you need the name of
> the 'id' field to be 'membership_id', you can simply define the field type
> as 'id' (seehttp://web2py.com/book/default/chapter/06?search=auto-increment
> ).
>
> Also, you should use Field() instead of SQLField() -- they're both the same,
> but the latter has been deprecated in favor of the former.
>
> Anthony
>
> On Monday, April 4, 2011 8:35:00 AM UTC-4, Neveen Adel wrote:
> > Hello,
>
> > I have the following table:
>
> >  db.define_table("member",
> >       SQLField("membership_id", "integer",notnull=True),
> >       SQLField("first_name", "string", notnull=True)
> > )
>
> > and i want  the membership id to be incremented automatically.
>
> > the way i used :
>
> >  every time i inserted it , i select the max membership_id and adding
> > one on its value as:
>
> >   result=db.executesql("select max(membership_id) from member")
> >   record=result[0]
> >   if record[0]:
> >     next_membership_id = record[0]+1
> >   else:
> >      next_membership_id=1
> >    form.vars.membership_id=next_membership_id
>
> > But this solution allows duplicates??
>
> > could anyone tell me  what is the perfect solution?
>
> > Thanks in Advance


[web2py] T usage

2011-04-04 Thread niknok
I tried:
Field('color', 'list:string', default=answer,
requires=IS_IN_SET(T(question['choices']), zero=None, multiple=True))

I would like to display the choices in the translated language but the
selection will be stored in the database in the orginal language. For
example:

choices = ['Gold', 'Silver']
What the user sees: ['Oro', 'Plata']
What is stored in the database (as the case, maybe): |Gold|Silver|

And if I need to display the selection (default=answer), Oro and Plata
will be re-selected.


[web2py] Re: extra element in form toggles automatically

2011-04-04 Thread Massimo Di Pierro
It is because of this

value=True

If you remove it will not be always set to true.


On Apr 4, 1:20 am, Rohan  wrote:
> I am creating an extra element in form as per 
> guidehttp://web2py.com/book/default/chapter/07#Adding-extra-form-elements-...
>
> here is the code
>
> controller
> settings_form = SQLFORM(db.auth_user, record, fields = ['first_name',
> 'email'], labels = {'first_name' : 'Full Name', 'email': 'Email
> Address'}, submit_button = 'Submit', showid=False)
>
> custom_checkbox = TR(LABEL(), TD(INPUT(_name='agree',value=True,
> _type='checkbox'), LABEL('Some setting')))
>     settings_form[0].insert(-1, custom_checkbox)
>
> view
>
> Preferences:
> {{=LOAD('default', 'settings', ajax=True, target='TargetDiv')}}
>
> on submitting this form from page, the checkbox value toggle itself.
> If it's on, after submitting, it will be set to off and if it's on
> then on submitting, it will be reset to on.
>
> I also tried this code in simple bare minimum welcome application to
> check if any javascript inserted from my end is causing this issue but
> faced same issue.
>
> Any pointers?


[web2py] .represent = ... in left join

2011-04-04 Thread Johann Spies
I want to get a proper representation of a field in the result of a left
join but am struggling to do so.

Here is a simplified version of the problem.

db.define_table('courses',
Field('week','integer', requires=IS_IN_SET([1,2]),
  widget = SQLFORM.widgets.radio.widget),
Field('code'),
format='%(code)s')

week1 = db(db.courses.week ==1)
week2 = db(db.courses.week ==2)

db.define_table('t_registration_form',
Field('f_attendee', db.auth_user,default=auth.user_id,
  label=T('Attendee'),writable=False,readable=True),
Field('course_week1',  db.courses,
  requires = IS_IN_DB(db(db.courses.week == 1),db.courses.id
,'%(code)s',),
  label=T('Course for week 1')),
Field('course_week2',  db.courses,
  requires = IS_IN_DB(db(db.courses.week == 2),db.courses.id
,'%(code)s',),
  label=T('Course for week 2')),
)

#db.t_registration_form.course_week1.represent = lambda x:
db.courses(x).code
#db.t_registration_form.course_week2.represent = lambda x:
db.courses(x).code

The query:
r1 = db().select(
db.auth_user.first_name, db.auth_user.last_name,
db.t_registration_form.course_week1,
db.t_registration_form.course_week2,
left = db.t_registration_form.on((db.auth_user.id ==
db.t_registration_form.f_attendee)&

(db.t_registration_form.active==True)),

orderby=db.t_registration_form.course_week1|db.t_registration_form.course_week2)

Not all the users have registered for courses.

In the result I  get the id's for the fields db.t_registration_form.week1
and week2.  I would like the db.courses.code there but when  I uncomment
the commented lines above, I get the error:

AttributeError: 'NoneType' object has no attribute 'code'


How can get represent to work in this case?

If I do a left join with three tables (db.courses included)  I have to use
((db.t_registration_form.course_week1 ==
db.courses.id)|(db.t_registration_form.course_week2
== db.courses.id)) and then ends up with two lines per user who have
registered for both weeks - and my client does not like that.

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: SyntaxError: setting key 'change_password_onvalidation' does not exist

2011-04-04 Thread Massimo Di Pierro
oops. Bug. fixed in trunk.

On Apr 4, 3:58 am, "Ab..."  wrote:
> Hello,
>
> In an application that allows password column in auth_user table to be
> null as it uses facebook login also, I have a change password auth
> form where I'd like to force validation that new password can not be
> blank..
>
> Based onhttp://web2py.com/book/default/chapter/08#Authenticationa
> few lines below "Settings and Messages" heading, I am trying to do :
>
> auth.settings.change_password_onvalidation = lambda form:
> passwordvalidation(form))
> def passwordvalidation(form):
>     print "do validation"
>
> But I am getting an error saying : raise SyntaxError, 'setting key \'%s
> \' does not exist' % key
> SyntaxError: setting key 'change_password_onvalidation' does not exist
>
> Any pointers?


[web2py] Re: MongoDB and Web2Py

2011-04-04 Thread Massimo Di Pierro
DAL allows to do:

db=DAL('mongodb://127.0.0.1:5984/db')

it allows to define_table and allows db.table.insert(...) other
methods have not been implemented because the above was never tested.
If you help us with testing I can implement the other methods (select,
count, update).

On Apr 1, 9:55 am, "David J."  wrote:
> While DAL might not support MongDB; you can still use it via mongoengine;
>
> On 4/1/11 10:41 AM, Marcel Luethi wrote:
>
>
>
>
>
>
>
> > Despite a lot of time, I'd like to help as well.
> > MongoDB looks promising.
>
> > On 1 Apr., 04:58, Massimo Di Pierro
> > wrote:
> >> Lots of people asked for support but nobody volunteered to help test
> >> it.
> >> If you are interested and can help with some regular tests we can make
> >> it work in relatively short time.
>
> >> Massimo
>
> >> On Mar 31, 9:09 pm, luckysmack  wrote:
>
> >>> I have read a few older messages about mongoDB being made to work with
> >>> the DAL. But they all seem to be pretty dated and have not specified
> >>> what was working and what wasnt. massimo menitoned that it may be
> >>> ready by january of this year. But under the supported list it wasnt
> >>> listed. So im just curious as to what the status of using mongoDB is
> >>> with web2py and if anyone has a basic example on how I would use it.
> >>> Thanks


[web2py] Re: Funny behavior with referenced Field display if writable=False

2011-04-04 Thread Massimo Di Pierro
It would help to have a smaller example to understand the problem
better. Can you reproduce it with one table with 1-2 fields and one
action?

On Apr 4, 5:30 am, szimszon  wrote:
> Can I help with something?
>
> On márc. 30, 08:55, szimszon  wrote:
>
>
>
>
>
>
>
> > Any progress / comment?
>
> > On márc. 27, 22:04, szimszon  wrote:
>
> > > Hi!
>
> > > I use Version 1.94.6 (2011-03-27 18:20:38).
>
> > > I have in db:
> > > -
> > > db.define_table( 'mail_domain',
> > >                                                         Field( 
> > > 'domainname', 'string',
> > >                                                                           
> > >       label = 'Domain név',
> > >                                                                           
> > >       requires = IS_NOT_EMPTY()
> > >                                                                           
> > >       ),
> > >                                                         signature,
> > >                                                         migrate = 
> > > settings.migrate,
> > >                                                         )
> > > db.define_table( 'mail_domain_alias',
> > >                                                         Field( 
> > > 'mail_domain_id', db.mail_domain,
> > >                                                                           
> > >       label = 'Domain név',
> > >                                                                           
> > >       requires = IS_IN_DB( db, db.mail_domain.id, '%
> > > (domainname)s' ),
> > >                                                                           
> > >       *writable = False,*
> > >                                                                           
> > >       ),
> > >                                                         Field( 'alias', 
> > > 'string',
> > >                                                                           
> > >       label = 'Aliasz',
> > >                                                                           
> > >       requires = IS_NOT_EMPTY()
> > >                                                                           
> > >       ),
> > >                                                         signature,
> > >                                                         migrate = 
> > > settings.migrate,
> > >                                                         )
> > > --
>
> > > controller:
>
> > > 
> > > def domain():
> > >         form = crud.update( db.mail_domain, request.args( 0 ) )
> > >         return dict( form = form )
> > > def domainalias():
> > >         db.mail_domain_alias.mail_domain_id.default = 
> > > session.domainname_id
> > >         form = crud.update( db.mail_domain_alias, request.args( 0 ) )
> > >         return dict( form = form )
> > > def setdomain():
> > >         session.domainname_id = request.args( 0 )
> > >         session.domainname = db( db.mail_domain.id ==
> > > session.domainname_id ).select( db.mail_domain.domainname 
> > > ).first().domainname
> > >         redirect( URL( 'default', 'index' ) )
> > > -
>
> > > If the session.domainname_id is set to a valid mail_domain record ID,
> > > than the crud in domainalias shows the reference field as number and
> > > not as domainname string.
>
> > > But if I remove the writable=False in mail_domain_alias table's
> > > mail_domain_id field than I have a dropdown menu with the right record
> > > selected as domainname and not as ID number.
>
> > > I think the right behavior would be if I set the writable = True that
> > > I would see the right record not as ID but as %(domainname)s

[web2py] Re: New b2b site using web2py

2011-04-04 Thread Massimo Di Pierro
Look great. I will be using this!

On Apr 4, 12:12 am, JimK  wrote:
> Hello Everyone!
>
> I've been working on a business for some time and have finally
> launched it!  The web server for the main app and CAS are running on
> appengine using the web2py framework.  Please check it out and let me
> know what you think.  The url iswww.qakit.comand you can register
> for a free 2-person account to try it out.
>
> QAKit is the Jira Studio (http://www.atlassian.com/hosted/studio/) for
> early-stage startups; a fully configured and integrated suite of tools
> for agile development.  The suite includes Bugzilla, Testopia,
> Dokuwiki and Generate Data.
>
> Cheers!
>
> Jim Kellas


[web2py] Re: Get last inserted field value

2011-04-04 Thread Massimo Di Pierro
how about

db.define_table("member",
  SQLField("membership_id", "id"),
  SQLField("first_name", "string", notnull=True)
)

and "membership_id" would be your "id" field?

On Apr 4, 8:03 am, Neveen Adel  wrote:
> Thanks Anthony for your reply.
>
> The table already have an old data so i can't remove the column id or
> change in the database structure.
>
> Is there another solution in controller level not database level?
>
> Thanks in Advance
>
> On Apr 4, 2:54 pm, Anthony  wrote:
>
>
>
>
>
>
>
> > Your table already includes an 'id' field by default, which is an
> > auto-increment integer field starting at 1. Why do you need a separate
> > 'membership_id' field? If it's a legacy database and you need the name of
> > the 'id' field to be 'membership_id', you can simply define the field type
> > as 'id' (seehttp://web2py.com/book/default/chapter/06?search=auto-increment
> > ).
>
> > Also, you should use Field() instead of SQLField() -- they're both the same,
> > but the latter has been deprecated in favor of the former.
>
> > Anthony
>
> > On Monday, April 4, 2011 8:35:00 AM UTC-4, Neveen Adel wrote:
> > > Hello,
>
> > > I have the following table:
>
> > >  db.define_table("member",
> > >       SQLField("membership_id", "integer",notnull=True),
> > >       SQLField("first_name", "string", notnull=True)
> > > )
>
> > > and i want  the membership id to be incremented automatically.
>
> > > the way i used :
>
> > >  every time i inserted it , i select the max membership_id and adding
> > > one on its value as:
>
> > >   result=db.executesql("select max(membership_id) from member")
> > >   record=result[0]
> > >   if record[0]:
> > >     next_membership_id = record[0]+1
> > >   else:
> > >      next_membership_id=1
> > >    form.vars.membership_id=next_membership_id
>
> > > But this solution allows duplicates??
>
> > > could anyone tell me  what is the perfect solution?
>
> > > Thanks in Advance


[web2py] linked in group

2011-04-04 Thread Massimo Di Pierro
We had a linkedin group for some time. I now made it open (new linked
in feature). perhaps we should use it to post jobs.

massimo


[web2py] Re: Get last inserted field value

2011-04-04 Thread Neveen Adel
Thanks a lot  Massimo :)

The problem with this solution is that i have a table has member_id as
foreign key and by this solution that data will be lost.

so i searched for a solution on controller level.

Thanks

On Apr 4, 3:31 pm, Massimo Di Pierro 
wrote:
> how about
>
> db.define_table("member",
>       SQLField("membership_id", "id"),
>       SQLField("first_name", "string", notnull=True)
> )
>
> and "membership_id" would be your "id" field?
>
> On Apr 4, 8:03 am, Neveen Adel  wrote:
>
> > Thanks Anthony for your reply.
>
> > The table already have an old data so i can't remove the column id or
> > change in the database structure.
>
> > Is there another solution in controller level not database level?
>
> > Thanks in Advance
>
> > On Apr 4, 2:54 pm, Anthony  wrote:
>
> > > Your table already includes an 'id' field by default, which is an
> > > auto-increment integer field starting at 1. Why do you need a separate
> > > 'membership_id' field? If it's a legacy database and you need the name of
> > > the 'id' field to be 'membership_id', you can simply define the field type
> > > as 'id' 
> > > (seehttp://web2py.com/book/default/chapter/06?search=auto-increment
> > > ).
>
> > > Also, you should use Field() instead of SQLField() -- they're both the 
> > > same,
> > > but the latter has been deprecated in favor of the former.
>
> > > Anthony
>
> > > On Monday, April 4, 2011 8:35:00 AM UTC-4, Neveen Adel wrote:
> > > > Hello,
>
> > > > I have the following table:
>
> > > >  db.define_table("member",
> > > >       SQLField("membership_id", "integer",notnull=True),
> > > >       SQLField("first_name", "string", notnull=True)
> > > > )
>
> > > > and i want  the membership id to be incremented automatically.
>
> > > > the way i used :
>
> > > >  every time i inserted it , i select the max membership_id and adding
> > > > one on its value as:
>
> > > >   result=db.executesql("select max(membership_id) from member")
> > > >   record=result[0]
> > > >   if record[0]:
> > > >     next_membership_id = record[0]+1
> > > >   else:
> > > >      next_membership_id=1
> > > >    form.vars.membership_id=next_membership_id
>
> > > > But this solution allows duplicates??
>
> > > > could anyone tell me  what is the perfect solution?
>
> > > > Thanks in Advance


[web2py] Re: extra element in form toggles automatically

2011-04-04 Thread Rohan
If not always setting it to true, it's toggling it. Once on then off then on 
and so on, 

I modified code and set value based on boolean variable but had same issue.

custom_checkbox = TR(LABEL(), TD(INPUT(_name='agree',value=session.dummy, 
_type='checkbox'), LABEL('Some setting'))) 
settings_form[0].insert(-1, custom_checkbox) 

on form accept

session.dummy =(not session.dummy)


Re: [web2py] linked in group

2011-04-04 Thread Bruno Rocha
Can you post the link to the group please?

I see more than one web2py group on linkedin, and more than one web2py
page/group in facebook



On Mon, Apr 4, 2011 at 10:36 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> We had a linkedin group for some time. I now made it open (new linked
> in feature). perhaps we should use it to post jobs.
>
> massimo


[web2py] Re: Get last inserted field value

2011-04-04 Thread Ross Peoples
Massimo's idea would work, but the table would need to have "membership_id" 
set up as an identity field. If your existing structure requires you to 
manually fill in this value yourself, then you would have to do your inserts 
manually using executesql:

db.executesql("INSERT INTO member (membership_id, first_name) VALUES 
((SELECT MAX(membership_id) FROM member) + 1, 'bob')")

This may not be the exact SQL you would use, but it gets my point across. 
Also, you would not want to append the first_name value. You would want to 
use executesql() placeholders to sanitize the data to prevent SQL injection.

By doing the select in the same query as the insert, you can prevent 
duplicate membership_id's from being generated.


[web2py] Re: add / remove form field

2011-04-04 Thread DenesL

Could you explain a bit more?
I am not sure I understand.
Maybe an example.


On Apr 3, 10:39 pm, 黄祥  wrote:
> hello,
>
> i want to input many data simutanously in web2py to database.
> did anyone knows how to add / remove form field in web2py and then
> input it on database?
>
> thank you so much and best regards,
>
> stifan


[web2py] PDF writing under GAE

2011-04-04 Thread Arbie Samong
Did anyone figure out how to let users download pdf's that contains
data from the database under GAE? Appengine does not allow file
writing, and most pdf writing libraries I've tried involves
temporarily writing in the disk.


[web2py] Re: linked in group

2011-04-04 Thread Massimo Di Pierro
oops.

http://www.linkedin.com/groups?mostPopular=&gid=143976

On Apr 4, 8:43 am, Bruno Rocha  wrote:
> Can you post the link to the group please?
>
> I see more than one web2py group on linkedin, and more than one web2py
> page/group in facebook
>
> On Mon, Apr 4, 2011 at 10:36 AM, Massimo Di Pierro <
>
>
>
>
>
>
>
> massimo.dipie...@gmail.com> wrote:
> > We had a linkedin group for some time. I now made it open (new linked
> > in feature). perhaps we should use it to post jobs.
>
> > massimo


[web2py] Re: PDF writing under GAE

2011-04-04 Thread Massimo Di Pierro
does myfpdf require file writing? I did not check? If it does it
should be easy to change it to use a StringIO instead.

On Apr 4, 9:08 am, Arbie Samong  wrote:
> Did anyone figure out how to let users download pdf's that contains
> data from the database under GAE? Appengine does not allow file
> writing, and most pdf writing libraries I've tried involves
> temporarily writing in the disk.


Re: [web2py] .represent = ... in left join

2011-04-04 Thread Richard Vézina
Are course_week1 and course_week2 not null??

If not you need ...requires=IS_NULL_OR(IS_IN_DB(your requires) and in
...represent= you should use zero option (see book about that) or something
like that :

db.t_registration_form.course_week1.represent=\
lambda value: (value!=None and "%(code)s" %db.courses[value]) or 'None'

Richard

On Mon, Apr 4, 2011 at 9:21 AM, Johann Spies  wrote:

> I want to get a proper representation of a field in the result of a left
> join but am struggling to do so.
>
> Here is a simplified version of the problem.
>
> db.define_table('courses',
> Field('week','integer', requires=IS_IN_SET([1,2]),
>   widget = SQLFORM.widgets.radio.widget),
> Field('code'),
> format='%(code)s')
>
> week1 = db(db.courses.week ==1)
> week2 = db(db.courses.week ==2)
>
> db.define_table('t_registration_form',
> Field('f_attendee', db.auth_user,default=auth.user_id,
>   label=T('Attendee'),writable=False,readable=True),
> Field('course_week1',  db.courses,
>   requires = IS_IN_DB(db(db.courses.week == 1),db.courses.id
> ,'%(code)s',),
>   label=T('Course for week 1')),
> Field('course_week2',  db.courses,
>   requires = IS_IN_DB(db(db.courses.week == 2),db.courses.id
> ,'%(code)s',),
>   label=T('Course for week 2')),
> )
>
> #db.t_registration_form.course_week1.represent = lambda x:
> db.courses(x).code
> #db.t_registration_form.course_week2.represent = lambda x:
> db.courses(x).code
>
> The query:
> r1 = db().select(
> db.auth_user.first_name, db.auth_user.last_name,
> db.t_registration_form.course_week1,
> db.t_registration_form.course_week2,
> left = db.t_registration_form.on((db.auth_user.id ==
> db.t_registration_form.f_attendee)&
>
> (db.t_registration_form.active==True)),
>
> orderby=db.t_registration_form.course_week1|db.t_registration_form.course_week2)
>
> Not all the users have registered for courses.
>
> In the result I  get the id's for the fields db.t_registration_form.week1
> and week2.  I would like the db.courses.code there but when  I uncomment
> the commented lines above, I get the error:
>
> AttributeError: 'NoneType' object has no attribute 'code'
>
>
> How can get represent to work in this case?
>
> If I do a left join with three tables (db.courses included)  I have to use
> ((db.t_registration_form.course_week1 == 
> db.courses.id)|(db.t_registration_form.course_week2
> == db.courses.id)) and then ends up with two lines per user who have
> registered for both weeks - and my client does not like that.
>
> 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: PDF writing under GAE

2011-04-04 Thread Arbie Samong
When trying it out on localhost:8080 using the appengine sdk it
returns an IO error pointing out that writes aren't allowed. I'll be
looking into StringIO, thanks for the tip Massimo

Regards,
Arbie

On Apr 4, 10:10 pm, Massimo Di Pierro 
wrote:
> does myfpdf require file writing? I did not check? If it does it
> should be easy to change it to use a StringIO instead.
>
> On Apr 4, 9:08 am, Arbie Samong  wrote:
>
>
>
>
>
>
>
> > Did anyone figure out how to let users download pdf's that contains
> > data from the database under GAE? Appengine does not allow file
> > writing, and most pdf writing libraries I've tried involves
> > temporarily writing in the disk.


Re: [web2py] Re: PostgreSQL Error "SELECT DISTINCT, ORDER BY expressions must appear in select list"

2011-04-04 Thread fuga
I attach argument-variables that is passed to BaseAdapter.select() (by
using pydev).

Do you mean as such?


I'm working for sahana-eden project.
It will be used for the earthquake rescue of Japan.

http://eden.sahanafoundation.org/wiki


PostgreSQL errors are caused by some querys which succeeds on other DBs.
I want you to cooperate in the solution.

Thanks

2011/4/4 Massimo Di Pierro :
> Can you show us the web2py dal expression that caused the invalid
> query? Thanks!
>
> On Apr 3, 8:19 am, fuga  wrote:
>> web2py generate SQL that PostgreSQL doesn't accept.
>>
>> For instance,
>>
>> SELECT DISTINCT a.id, a.uid, a.name FROM a, b WHERE a.deleted <>
>> 'T') AND (a.id > 0)) AND (((b.deleted <> 'T') AND (b.id > 0)) AND
>> (b.id = 1))) AND (b.uid = a.uid)) ORDER BY b.id, a.id LIMIT 1 OFFSET
>> 0;
>>
>> It fails because select list is not contain "b.id".
>>
>> I change gluon/dal.py(Version 1.94.5) as follows.
>> It is work well.
>> But I am not sure that it is a good practice.
>>
>> === modified file 'gluon/dal.py'   Version 1.94.5
>> @@ -1039,2 +1039,6 @@
>> --
>> if not orderby and tablenames:
>> -    sql_o +=  ['%s.%s'%(t,x) for t in tablenames for x in
>> ((hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey) or
>> [self.db[t]._id.name])]
>> +    orderby_fields = ['%s.%s'%(t,x) for t in tablenames for x in
>> ((hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey) or
>> [self.db[t]._id.name])]
>> +    sql_o += ' ORDER BY %s' % ', '.join(orderby_fields)
>> +    for orderby_field in orderby_fields:
>> +        if orderby_field not in self._colnames:
>> +            sql_f += ', %s' % orderby_field
>>
>> Your opinion will be much appreciated,
>> Cheers,


variables
Description: Binary data


Re: [web2py] url rewriting

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 5:02 AM, Ahmed Sharkawy wrote:
> I use GAE and I use the app.yaml to solve this
> but there is anther problem
> I have more than one function in the file so I want to point to the specific 
> function
> 
> the code in app.yaml is
> - url: /login
>   script: applications\init\controllers\login.py

I don't think this can work. The stock web2py app.yaml routes all web2py 
requests like this:

- url: .*
  script: gaehandler.py
  secure: optional

...where gaehandler.py is the gateway script, as it were, to web2py in a GAE 
environment. 

> 
> but if I have a script contain 2 functions how to point to one of them ?

web2py will pick out the right function from the URL, but you have to go 
through the handler. Use routes.py to shorten the URLs if you need to.

> 
> Thanks for your patience and your ideas
> 
> 
> 
> On 3 April 2011 23:38, Jonathan Lundell  wrote:
> On Apr 3, 2011, at 2:22 PM, pbreit wrote:
> >
> > Oh right, cuz login is going to be /user/login ?
> 
> Well, that too, but simply setting default_application (without any routing) 
> will never suppress the application unless it's also suppressing the 
> controller and function.
> 





[web2py] Re: Get last inserted field value

2011-04-04 Thread Neveen Adel
Thanks a lot all of you for your help :)

Am thinking to make the default value of membership_id equal to id and
by that  duplicates will never occurred and also am not need to remove
id column.


Thanks again for ur help :)

On Apr 4, 3:44 pm, Ross Peoples  wrote:
> Massimo's idea would work, but the table would need to have "membership_id"
> set up as an identity field. If your existing structure requires you to
> manually fill in this value yourself, then you would have to do your inserts
> manually using executesql:
>
> db.executesql("INSERT INTO member (membership_id, first_name) VALUES
> ((SELECT MAX(membership_id) FROM member) + 1, 'bob')")
>
> This may not be the exact SQL you would use, but it gets my point across.
> Also, you would not want to append the first_name value. You would want to
> use executesql() placeholders to sanitize the data to prevent SQL injection.
>
> By doing the select in the same query as the insert, you can prevent
> duplicate membership_id's from being generated.


[web2py] Re: PDF writing under GAE

2011-04-04 Thread Arbie Samong
OK what I'm trying right now is something straight out of the wiki:

html = response.render('default/download.html', locals())

class MyFPDF(FPDF, HTMLMixin):
  def header(self):
self.set_font('Arial','B',15)
self.cell(0,10, response.title ,1,0,'C')
self.ln(20)

  def footer(self):
self.set_y(-15)
self.set_font('Arial','I',8)
txt = 'Page %s of %s' % (self.page_no(), self.alias_nb_pages())
self.cell(0,10,txt,0,0,'C')

pdf.add_page()
pdf.write_html(html)
response.headers['Content-Type']='application/pdf'
return pdf.output(dest='S')

and it gives the error:
RuntimeError: FPDF error: PIL not installed

in which I copied the PIL/ folder from /usr/lib/python2.6/dist-
packages/PIL to the web2py/site-packages/ folder and no effect. PIL is
already installed in the system, as well as in the virtualenv I'm
using.

Regards,
Arbie


On Apr 4, 10:15 pm, Arbie Samong  wrote:
> When trying it out on localhost:8080 using the appengine sdk it
> returns an IO error pointing out that writes aren't allowed. I'll be
> looking into StringIO, thanks for the tip Massimo
>
> Regards,
> Arbie
>
> On Apr 4, 10:10 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > does myfpdf require file writing? I did not check? If it does it
> > should be easy to change it to use a StringIO instead.
>
> > On Apr 4, 9:08 am, Arbie Samong  wrote:
>
> > > Did anyone figure out how to let users download pdf's that contains
> > > data from the database under GAE? Appengine does not allow file
> > > writing, and most pdf writing libraries I've tried involves
> > > temporarily writing in the disk.


[web2py] Re: PDF writing under GAE

2011-04-04 Thread Arbie Samong
OK update, PIL is being required because I have an image tag in my
view, I removed the tag and the pdf was downloaded fine. Would love to
have images written properly, though.

Regards,
Arbie

On Apr 4, 10:30 pm, Arbie Samong  wrote:
> OK what I'm trying right now is something straight out of the wiki:
>
> html = response.render('default/download.html', locals())
>
> class MyFPDF(FPDF, HTMLMixin):
>   def header(self):
>     self.set_font('Arial','B',15)
>     self.cell(0,10, response.title ,1,0,'C')
>     self.ln(20)
>
>   def footer(self):
>     self.set_y(-15)
>     self.set_font('Arial','I',8)
>     txt = 'Page %s of %s' % (self.page_no(), self.alias_nb_pages())
>     self.cell(0,10,txt,0,0,'C')
>
> pdf.add_page()
> pdf.write_html(html)
> response.headers['Content-Type']='application/pdf'
> return pdf.output(dest='S')
>
> and it gives the error:
> RuntimeError: FPDF error: PIL not installed
>
> in which I copied the PIL/ folder from /usr/lib/python2.6/dist-
> packages/PIL to the web2py/site-packages/ folder and no effect. PIL is
> already installed in the system, as well as in the virtualenv I'm
> using.
>
> Regards,
> Arbie
>
> On Apr 4, 10:15 pm, Arbie Samong  wrote:
>
>
>
>
>
>
>
> > When trying it out on localhost:8080 using the appengine sdk it
> > returns an IO error pointing out that writes aren't allowed. I'll be
> > looking into StringIO, thanks for the tip Massimo
>
> > Regards,
> > Arbie
>
> > On Apr 4, 10:10 pm, Massimo Di Pierro 
> > wrote:
>
> > > does myfpdf require file writing? I did not check? If it does it
> > > should be easy to change it to use a StringIO instead.
>
> > > On Apr 4, 9:08 am, Arbie Samong  wrote:
>
> > > > Did anyone figure out how to let users download pdf's that contains
> > > > data from the database under GAE? Appengine does not allow file
> > > > writing, and most pdf writing libraries I've tried involves
> > > > temporarily writing in the disk.


[web2py] Re: Get last inserted field value

2011-04-04 Thread Anthony
On Monday, April 4, 2011 9:39:31 AM UTC-4, Neveen Adel wrote: 
>
> Thanks a lot  Massimo :) 
>
> The problem with this solution is that i have a table has member_id as 
> foreign key and by this solution that data will be lost.

 
Are you saying in the legacy database, the 'member' table has a 
'membership_id' field, which is an auto-increment integer field and is 
linked as a foreign key in one or more other tables? In that case, why 
wouldn't Massimo's suggestion work? If you specify Field('membership_id', 
type='id'), you are telling web2py not to create a field named 'id', but 
instead to use the 'membership_id' field as the auto-incrementing primary 
key for the 'member' table. I would think it would still work as a foreign 
key in other tables in that case. Have you tried it?
 
Also, as an aside, if you need the MAX of a field, I believe the web2py DAL 
has a max() method (as well as min and sum), but it doesn't appear to be 
documented in the book, and I'm not sure about the details of its usage. 
Perhaps Massimo or someone else can elaborate (and maybe even update the 
book).
 
Anthony
 
 

> On Apr 4, 3:31 pm, Massimo Di Pierro  
> wrote: 
> > how about 
> > 
> > db.define_table("member", 
> >   SQLField("membership_id", "id"), 
> >   SQLField("first_name", "string", notnull=True) 
> > ) 
> > 
> > and "membership_id" would be your "id" field? 
> > 
> > On Apr 4, 8:03 am, Neveen Adel  wrote: 
> > 
> > > Thanks Anthony for your reply. 
> > 
> > > The table already have an old data so i can't remove the column id or 
> > > change in the database structure. 
> > 
> > > Is there another solution in controller level not database level? 
> > 
> > > Thanks in Advance 
> > 
> > > On Apr 4, 2:54 pm, Anthony  wrote: 
> > 
> > > > Your table already includes an 'id' field by default, which is an 
> > > > auto-increment integer field starting at 1. Why do you need a 
> separate 
> > > > 'membership_id' field? If it's a legacy database and you need the 
> name of 
> > > > the 'id' field to be 'membership_id', you can simply define the field 
> type 
> > > > as 'id' (seehttp://
> web2py.com/book/default/chapter/06?search=auto-increment 
> > > > ). 
> > 
> > > > Also, you should use Field() instead of SQLField() -- they're both 
> the same, 
> > > > but the latter has been deprecated in favor of the former. 
> > 
> > > > Anthony 
> > 
> > > > On Monday, April 4, 2011 8:35:00 AM UTC-4, Neveen Adel wrote: 
> > > > > Hello, 
> > 
> > > > > I have the following table: 
> > 
> > > > >  db.define_table("member", 
> > > > >   SQLField("membership_id", "integer",notnull=True), 
> > > > >   SQLField("first_name", "string", notnull=True) 
> > > > > ) 
> > 
> > > > > and i want  the membership id to be incremented automatically. 
> > 
> > > > > the way i used : 
> > 
> > > > >  every time i inserted it , i select the max membership_id and 
> adding 
> > > > > one on its value as: 
> > 
> > > > >   result=db.executesql("select max(membership_id) from member") 
> > > > >   record=result[0] 
> > > > >   if record[0]: 
> > > > > next_membership_id = record[0]+1 
> > > > >   else: 
> > > > >  next_membership_id=1 
> > > > >form.vars.membership_id=next_membership_id 
> > 
> > > > > But this solution allows duplicates?? 
> > 
> > > > > could anyone tell me  what is the perfect solution? 
> > 
> > > > > Thanks in Advance



[web2py] Re: T usage

2011-04-04 Thread DenesL

Use

choices = {'Gold':T('Gold'), 'Silver':T('Silver')}

and update your language translations strings.
Not sure how "answer" is obtained.


On 4 abr, 09:16, niknok  wrote:
> I tried:
> Field('color', 'list:string', default=answer,
> requires=IS_IN_SET(T(question['choices']), zero=None, multiple=True))
>
> I would like to display the choices in the translated language but the
> selection will be stored in the database in the orginal language. For
> example:
>
> choices = ['Gold', 'Silver']
> What the user sees: ['Oro', 'Plata']
> What is stored in the database (as the case, maybe): |Gold|Silver|
>
> And if I need to display the selection (default=answer), Oro and Plata
> will be re-selected.


[web2py] 1.94.6 site-packages

2011-04-04 Thread Will Stevens
I just wanted to point out that the 'site-packages' directory is
missing in the source download of the 1.94.6 version.

I added the directory in my project and added back in my libs and
everything is working.  It just looks like the empty directory was
left out in this last version.

Cheers...


[web2py] Bug in openid_auth.py

2011-04-04 Thread Will Stevens
I am not sure where I should be putting bug reports, so please let me
know.

There is a bug in 'gluon/contrib/login_methods/openid_auth.py'.

On line 244:
- self.db.alt_logins.insert(username=oid, user=user)
+ self.db.alt_logins.insert(username=oid, user=user.id) # there is a
DB error when trying to insert the object.  changing to the id fixed
it.

This next bug appears to be only with GAE, but I think its a bad
practice and should be fixed.
On line 243:
- print "[DB] %s authenticated" % oid
+ # print "[DB] %s authenticated" % oid  # this breaks GAE

When the 'print' is done on the local server, it just prints it to the
console (not an issue), but on GAE, it adds it as part of the response
and sends it before the headers which causes the redirect after
authentication to fail.

With these two fixes I have successfully gotten OpenID working on
GAE.  More details can be found here:
http://groups.google.com/group/web2py/browse_thread/thread/4a8efd13814358b9/2d852852418a1673?#2d852852418a1673

Cheers and let me know if you have questions.


[web2py] Re: eliminate 'column-header' titles from query response?

2011-04-04 Thread Anthony
Hi James,
 
Yes, why don't you send a simple app that replicates the errors you are 
seeing.
 
A few comments below...

On Monday, April 4, 2011 4:22:22 AM UTC-4, james c. wrote:

> thanks, james c. 
>
>
>  
> Late Friday, while grasping at things like string output conversions 
> as possible solutions, I found  alternate dictionary iterative methods 
> - after which I had a solution working in about two minutes. It just 
> worked. here it is: 
>
> cpp=db(db.customer_names.id==name_index).select().as_dict()

 
Note, a select() returns a Rows object, but as_dict() should be applied to a 
Row object (though perhaps it works if the Rows object includes only one 
Row). I think you should either use as_list (to get a list containing a 
single dictionary for the row), or use .first().as_dict().
 

> db(db.customer_names.id==names_index).select('name').first().name 
>
> I could get something similar to this running in the console. My 
> web2py is using the default Python254. With Python254, adding first() 
> or .name, results in a compile or syntax error. The least common parts 
> of this code that I got to work is: 
>
> pcc=db(db.customer_names.id==names_index).select('name') 
>
> this is returned through to the view as  return 
> dict(display_name=pcc...)  and in the view {{=display_name}}. In this 
> case I believe the functions are returning html because the resulting 
> web page output is formated such as: 
>
> NAME 
> -- 
>  The Big

 
Note, in your example above, 'display_name' is a Rows object. When you write 
a Rows object in a view, web2py converts it to a SQLTABLE object, which is 
rendered as an HTML table as above. This is explained here: 
http://web2py.com/book/default/chapter/06#Serializing-Rows-in-Views
 

>  
> I could get code working (in a manner similar to what you suggest) with 
> the three versions of python in console to retrieve specific 
> dictionary items, but in Web2py the system seems to not be recognizing 
> these returned items as lists or as dictionaries.

 
What do you mean you could get it working in the console? Are you saying you 
ran web2py in shell mode, and it worked, or you were just playing around 
with lists and dictionaries in a Python shell, but not using any web2py 
objects?
 
Anthony


[web2py] Re: PDF writing under GAE

2011-04-04 Thread Arbie Samong
Follow-up question, how do I get PIL to be recognized as installed? I
tried easy_install on the whole system, then on the virtual env, then
copying the PIL/ folder to site-packages, but nothing seems to work.

Thanks,
Arbie

On Apr 4, 10:35 pm, Arbie Samong  wrote:
> OK update, PIL is being required because I have an image tag in my
> view, I removed the tag and the pdf was downloaded fine. Would love to
> have images written properly, though.
>
> Regards,
> Arbie
>
> On Apr 4, 10:30 pm, Arbie Samong  wrote:
>
>
>
>
>
>
>
> > OK what I'm trying right now is something straight out of the wiki:
>
> > html = response.render('default/download.html', locals())
>
> > class MyFPDF(FPDF, HTMLMixin):
> >   def header(self):
> >     self.set_font('Arial','B',15)
> >     self.cell(0,10, response.title ,1,0,'C')
> >     self.ln(20)
>
> >   def footer(self):
> >     self.set_y(-15)
> >     self.set_font('Arial','I',8)
> >     txt = 'Page %s of %s' % (self.page_no(), self.alias_nb_pages())
> >     self.cell(0,10,txt,0,0,'C')
>
> > pdf.add_page()
> > pdf.write_html(html)
> > response.headers['Content-Type']='application/pdf'
> > return pdf.output(dest='S')
>
> > and it gives the error:
> > RuntimeError: FPDF error: PIL not installed
>
> > in which I copied the PIL/ folder from /usr/lib/python2.6/dist-
> > packages/PIL to the web2py/site-packages/ folder and no effect. PIL is
> > already installed in the system, as well as in the virtualenv I'm
> > using.
>
> > Regards,
> > Arbie
>
> > On Apr 4, 10:15 pm, Arbie Samong  wrote:
>
> > > When trying it out on localhost:8080 using the appengine sdk it
> > > returns an IO error pointing out that writes aren't allowed. I'll be
> > > looking into StringIO, thanks for the tip Massimo
>
> > > Regards,
> > > Arbie
>
> > > On Apr 4, 10:10 pm, Massimo Di Pierro 
> > > wrote:
>
> > > > does myfpdf require file writing? I did not check? If it does it
> > > > should be easy to change it to use a StringIO instead.
>
> > > > On Apr 4, 9:08 am, Arbie Samong  wrote:
>
> > > > > Did anyone figure out how to let users download pdf's that contains
> > > > > data from the database under GAE? Appengine does not allow file
> > > > > writing, and most pdf writing libraries I've tried involves
> > > > > temporarily writing in the disk.


[web2py] Re: Congratulations to this mailing list

2011-04-04 Thread Mengu
i don't believe that you've said this on purpose yet you would wish
something more for web2py. however have you ever joined the django irc
room or the mailing list? have you ever seen the questions asked over
and over of which answers already said in that -really- great
documentation?

On Apr 4, 2:28 pm, "Sebastian E. Ovide" 
wrote:
> On Mon, Apr 4, 2011 at 12:53 AM, Massimo Di Pierro <
>
> massimo.dipie...@gmail.com> wrote:
> > I mined some data from:
>
> >http://groups.google.com/group/web2py/about
> >http://groups.google.com/group/django-users/about
>
> > This web2py users group had 56,283 messages posted since 1/1/2009. The
> > Django-users list had 51,119 over the same time period.
>
> Very good it shows that web2py has more messages what does it really
> mean apart than web2py mailing has more messages ?
>
> Django has a really good documentation and perhaps people need to ask less ?
>
> Django releases less versions and therefore people need to ask less
> (web2py releases always a couple of "stable" versions after a "stable"
> version has been released as it alwasy has few bugs)
>
> Congratulations to all of you!
>
>
>
> > Massimo
>
> Congratulation to all of you ! great community !
>
> --
> Sebastian E. Ovide


Re: [web2py] Re: MongoDB and Web2Py

2011-04-04 Thread David J.


Thanks Massimo;

I never thought to even try this;
I will make a sample project and test this;
(For me the other way works; so I wouldn't ask that you implement it in 
DAL; (but I am happy to test it;)


Thanks for your great software.

David.





On 4/4/11 9:24 AM, Massimo Di Pierro wrote:

DAL allows to do:

db=DAL('mongodb://127.0.0.1:5984/db')

it allows to define_table and allows db.table.insert(...) other
methods have not been implemented because the above was never tested.
If you help us with testing I can implement the other methods (select,
count, update).

On Apr 1, 9:55 am, "David J."  wrote:

While DAL might not support MongDB; you can still use it via mongoengine;

On 4/1/11 10:41 AM, Marcel Luethi wrote:








Despite a lot of time, I'd like to help as well.
MongoDB looks promising.
On 1 Apr., 04:58, Massimo Di Pierro
wrote:

Lots of people asked for support but nobody volunteered to help test
it.
If you are interested and can help with some regular tests we can make
it work in relatively short time.
Massimo
On Mar 31, 9:09 pm, luckysmackwrote:

I have read a few older messages about mongoDB being made to work with
the DAL. But they all seem to be pretty dated and have not specified
what was working and what wasnt. massimo menitoned that it may be
ready by january of this year. But under the supported list it wasnt
listed. So im just curious as to what the status of using mongoDB is
with web2py and if anyone has a basic example on how I would use it.
Thanks




Re: [web2py] main menu z-index

2011-04-04 Thread ron_m
Are you using IE as the browser? I had a similar problem show up with video 
displayed in an ActiveX control but it worked fine in anything but IE. In 
the end it was presumed this was an IE issue with CSS based menu posting so 
I went away from pull down submenus with having to support IE8.


Re: [web2py] Re: PDF writing under GAE

2011-04-04 Thread Martín Mulone
Perhaps changing this line in fpdf:

http://code.google.com/p/pyfpdf/source/browse/fpdf.py#21

with this one work

from google.appengine.api import images


2011/4/4 Arbie Samong 

> Follow-up question, how do I get PIL to be recognized as installed? I
> tried easy_install on the whole system, then on the virtual env, then
> copying the PIL/ folder to site-packages, but nothing seems to work.
>
> Thanks,
> Arbie
>
> On Apr 4, 10:35 pm, Arbie Samong  wrote:
> > OK update, PIL is being required because I have an image tag in my
> > view, I removed the tag and the pdf was downloaded fine. Would love to
> > have images written properly, though.
> >
> > Regards,
> > Arbie
> >
> > On Apr 4, 10:30 pm, Arbie Samong  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > OK what I'm trying right now is something straight out of the wiki:
> >
> > > html = response.render('default/download.html', locals())
> >
> > > class MyFPDF(FPDF, HTMLMixin):
> > >   def header(self):
> > > self.set_font('Arial','B',15)
> > > self.cell(0,10, response.title ,1,0,'C')
> > > self.ln(20)
> >
> > >   def footer(self):
> > > self.set_y(-15)
> > > self.set_font('Arial','I',8)
> > > txt = 'Page %s of %s' % (self.page_no(), self.alias_nb_pages())
> > > self.cell(0,10,txt,0,0,'C')
> >
> > > pdf.add_page()
> > > pdf.write_html(html)
> > > response.headers['Content-Type']='application/pdf'
> > > return pdf.output(dest='S')
> >
> > > and it gives the error:
> > > RuntimeError: FPDF error: PIL not installed
> >
> > > in which I copied the PIL/ folder from /usr/lib/python2.6/dist-
> > > packages/PIL to the web2py/site-packages/ folder and no effect. PIL is
> > > already installed in the system, as well as in the virtualenv I'm
> > > using.
> >
> > > Regards,
> > > Arbie
> >
> > > On Apr 4, 10:15 pm, Arbie Samong  wrote:
> >
> > > > When trying it out on localhost:8080 using the appengine sdk it
> > > > returns an IO error pointing out that writes aren't allowed. I'll be
> > > > looking into StringIO, thanks for the tip Massimo
> >
> > > > Regards,
> > > > Arbie
> >
> > > > On Apr 4, 10:10 pm, Massimo Di Pierro 
> > > > wrote:
> >
> > > > > does myfpdf require file writing? I did not check? If it does it
> > > > > should be easy to change it to use a StringIO instead.
> >
> > > > > On Apr 4, 9:08 am, Arbie Samong  wrote:
> >
> > > > > > Did anyone figure out how to let users download pdf's that
> contains
> > > > > > data from the database under GAE? Appengine does not allow file
> > > > > > writing, and most pdf writing libraries I've tried involves
> > > > > > temporarily writing in the disk.
>



-- 
My blog: http://martin.tecnodoc.com.ar
Expert4Solution: http://www.experts4solutions.com/e4s/default/expert/6
http://www.cvstash.com/profile/Xzi5bWCdD


Re: [web2py] Re: linked in group

2011-04-04 Thread Bruno Rocha
This group needs a profile image.


On Mon, Apr 4, 2011 at 11:08 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> oops.
>
> http://www.linkedin.com/groups?mostPopular=&gid=143976
>
> On Apr 4, 8:43 am, Bruno Rocha  wrote:
> > Can you post the link to the group please?
> >
> > I see more than one web2py group on linkedin, and more than one web2py
> > page/group in facebook
> >
> > On Mon, Apr 4, 2011 at 10:36 AM, Massimo Di Pierro <
> >
> >
> >
> >
> >
> >
> >
> > massimo.dipie...@gmail.com> wrote:
> > > We had a linkedin group for some time. I now made it open (new linked
> > > in feature). perhaps we should use it to post jobs.
> >
> > > massimo
>


[web2py] Re: PDF writing under GAE

2011-04-04 Thread Arbie Samong
Hi Martin, that worked flawlessly ;) Thanks!

Regards,
Arbie

On Apr 4, 11:56 pm, Martín Mulone  wrote:
> Perhaps changing this line in fpdf:
>
> http://code.google.com/p/pyfpdf/source/browse/fpdf.py#21
>
> with this one work
>
> from google.appengine.api import images
> 
>
> 2011/4/4 Arbie Samong 
>
>
>
>
>
>
>
>
>
> > Follow-up question, how do I get PIL to be recognized as installed? I
> > tried easy_install on the whole system, then on the virtual env, then
> > copying the PIL/ folder to site-packages, but nothing seems to work.
>
> > Thanks,
> > Arbie
>
> > On Apr 4, 10:35 pm, Arbie Samong  wrote:
> > > OK update, PIL is being required because I have an image tag in my
> > > view, I removed the tag and the pdf was downloaded fine. Would love to
> > > have images written properly, though.
>
> > > Regards,
> > > Arbie
>
> > > On Apr 4, 10:30 pm, Arbie Samong  wrote:
>
> > > > OK what I'm trying right now is something straight out of the wiki:
>
> > > > html = response.render('default/download.html', locals())
>
> > > > class MyFPDF(FPDF, HTMLMixin):
> > > >   def header(self):
> > > >     self.set_font('Arial','B',15)
> > > >     self.cell(0,10, response.title ,1,0,'C')
> > > >     self.ln(20)
>
> > > >   def footer(self):
> > > >     self.set_y(-15)
> > > >     self.set_font('Arial','I',8)
> > > >     txt = 'Page %s of %s' % (self.page_no(), self.alias_nb_pages())
> > > >     self.cell(0,10,txt,0,0,'C')
>
> > > > pdf.add_page()
> > > > pdf.write_html(html)
> > > > response.headers['Content-Type']='application/pdf'
> > > > return pdf.output(dest='S')
>
> > > > and it gives the error:
> > > > RuntimeError: FPDF error: PIL not installed
>
> > > > in which I copied the PIL/ folder from /usr/lib/python2.6/dist-
> > > > packages/PIL to the web2py/site-packages/ folder and no effect. PIL is
> > > > already installed in the system, as well as in the virtualenv I'm
> > > > using.
>
> > > > Regards,
> > > > Arbie
>
> > > > On Apr 4, 10:15 pm, Arbie Samong  wrote:
>
> > > > > When trying it out on localhost:8080 using the appengine sdk it
> > > > > returns an IO error pointing out that writes aren't allowed. I'll be
> > > > > looking into StringIO, thanks for the tip Massimo
>
> > > > > Regards,
> > > > > Arbie
>
> > > > > On Apr 4, 10:10 pm, Massimo Di Pierro 
> > > > > wrote:
>
> > > > > > does myfpdf require file writing? I did not check? If it does it
> > > > > > should be easy to change it to use a StringIO instead.
>
> > > > > > On Apr 4, 9:08 am, Arbie Samong  wrote:
>
> > > > > > > Did anyone figure out how to let users download pdf's that
> > contains
> > > > > > > data from the database under GAE? Appengine does not allow file
> > > > > > > writing, and most pdf writing libraries I've tried involves
> > > > > > > temporarily writing in the disk.
>
> --
> My blog:http://martin.tecnodoc.com.ar
> Expert4Solution:http://www.experts4solutions.com/e4s/default/expert/6http://www.cvstash.com/profile/Xzi5bWCdD


Re: [web2py] Re: Making my own decorator...

2011-04-04 Thread pbreit
What do decorators have access to? Full DB access?

[web2py] Web2py version 1.94.6 bug?

2011-04-04 Thread Christopher Steel
Running the latest version of Web2py and Python 2.7 on OS X  the I get
the following error when running wizard created applicaitons:

File "/Users/username/webapps/2010_04_04/web2py/applications/a/models/
menu.py", line 8, in 
 
(T('Index'),URL('default','index').xml()==URL().xml(),URL('default','index'),
[]),

AttributeError: 'str' object has no attribute 'xml'


[web2py] FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread mikech
I'd like to see some FAQ topics that can be pointed to on the usual FUD 
about Web2py.  For instance:

In web2py the code you write for the controller layer (views) goes into 
files that are not Python modules because they don't include any imports to 
give context to external identifiers. Web2py loads, compiles, and executes 
those modules at runtime passing a global context using Python's exec() 
function. That strange (and unjustified) way of doing things disables 
important capabilities of modern IDEs (code completion, code hints, help, 
static checking, refactoring) because those files are not Python modules. It 
also makes it very difficult to write unit tests for the controller layer, 
because the global runtime context of web2py cannot be mocked.

I tried to look for the Google thread in which Massimo addressed these and 
other issues, but the search didn't easily retrieve it, and though I knew 
that I had participated in it my profile history only showed posts thru the 
end of 2010.  


[web2py] Re: Web2py version 1.94.6 bug?

2011-04-04 Thread Anthony
Are you running from 1.94.6 or from trunk? I ask because a recent change was 
made to URL in trunk so it returns a string instead of an XML object (so, no 
more xml() method).
 
Anthony

On Monday, April 4, 2011 12:45:56 PM UTC-4, Christopher Steel wrote:

> Running the latest version of Web2py and Python 2.7 on OS X  the I get 
> the following error when running wizard created applicaitons: 
>
> File "/Users/username/webapps/2010_04_04/web2py/applications/a/models/ 
> menu.py", line 8, in  
>   
> (T('Index'),URL('default','index').xml()==URL().xml(),URL('default','index'), 
>
> []), 
>
> AttributeError: 'str' object has no attribute 'xml'



[web2py] Re: PostgreSQL Error "SELECT DISTINCT, ORDER BY expressions must appear in select list"

2011-04-04 Thread Massimo Di Pierro
We need to see the web2py expression that generates the problematic
query. From your comment it seems to me the problem is there.

On Apr 4, 9:24 am, fuga  wrote:
> I attach argument-variables that is passed to BaseAdapter.select() (by
> using pydev).
>
> Do you mean as such?
>
> I'm working for sahana-eden project.
> It will be used for the earthquake rescue of Japan.
>
> http://eden.sahanafoundation.org/wiki
>
> PostgreSQL errors are caused by some querys which succeeds on other DBs.
> I want you to cooperate in the solution.
>
> Thanks
>
> 2011/4/4 Massimo Di Pierro :
>
>
>
>
>
>
>
> > Can you show us the web2py dal expression that caused the invalid
> > query? Thanks!
>
> > On Apr 3, 8:19 am, fuga  wrote:
> >> web2py generate SQL that PostgreSQL doesn't accept.
>
> >> For instance,
>
> >> SELECT DISTINCT a.id, a.uid, a.name FROM a, b WHERE a.deleted <>
> >> 'T') AND (a.id > 0)) AND (((b.deleted <> 'T') AND (b.id > 0)) AND
> >> (b.id = 1))) AND (b.uid = a.uid)) ORDER BY b.id, a.id LIMIT 1 OFFSET
> >> 0;
>
> >> It fails because select list is not contain "b.id".
>
> >> I change gluon/dal.py(Version 1.94.5) as follows.
> >> It is work well.
> >> But I am not sure that it is a good practice.
>
> >> === modified file 'gluon/dal.py'   Version 1.94.5
> >> @@ -1039,2 +1039,6 @@
> >> --
> >> if not orderby and tablenames:
> >> -    sql_o +=  ['%s.%s'%(t,x) for t in tablenames for x in
> >> ((hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey) or
> >> [self.db[t]._id.name])]
> >> +    orderby_fields = ['%s.%s'%(t,x) for t in tablenames for x in
> >> ((hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey) or
> >> [self.db[t]._id.name])]
> >> +    sql_o += ' ORDER BY %s' % ', '.join(orderby_fields)
> >> +    for orderby_field in orderby_fields:
> >> +        if orderby_field not in self._colnames:
> >> +            sql_f += ', %s' % orderby_field
>
> >> Your opinion will be much appreciated,
> >> Cheers,
>
>
>
>  variables
> 2KViewDownload


[web2py] Re: 1.94.6 site-packages

2011-04-04 Thread Massimo Di Pierro
Problem is mercurial does not version control empty folder. It should
have been created at startup. Was it not?

On Apr 4, 9:46 am, Will Stevens  wrote:
> I just wanted to point out that the 'site-packages' directory is
> missing in the source download of the 1.94.6 version.
>
> I added the directory in my project and added back in my libs and
> everything is working.  It just looks like the empty directory was
> left out in this last version.
>
> Cheers...


[web2py] Re: Bug in openid_auth.py

2011-04-04 Thread Massimo Di Pierro
Thank you. It is now fixed in trunk.

On Apr 4, 9:57 am, Will Stevens  wrote:
> I am not sure where I should be putting bug reports, so please let me
> know.
>
> There is a bug in 'gluon/contrib/login_methods/openid_auth.py'.
>
> On line 244:
> - self.db.alt_logins.insert(username=oid, user=user)
> + self.db.alt_logins.insert(username=oid, user=user.id) # there is a
> DB error when trying to insert the object.  changing to the id fixed
> it.
>
> This next bug appears to be only with GAE, but I think its a bad
> practice and should be fixed.
> On line 243:
> - print "[DB] %s authenticated" % oid
> + # print "[DB] %s authenticated" % oid  # this breaks GAE
>
> When the 'print' is done on the local server, it just prints it to the
> console (not an issue), but on GAE, it adds it as part of the response
> and sends it before the headers which causes the redirect after
> authentication to fail.
>
> With these two fixes I have successfully gotten OpenID working on
> GAE.  More details can be found 
> here:http://groups.google.com/group/web2py/browse_thread/thread/4a8efd1381...
>
> Cheers and let me know if you have questions.


[web2py] Re: MongoDB and Web2Py

2011-04-04 Thread Massimo Di Pierro
If it is an option you may want to try with couchdb. That is very
close to completed. Only date/datetime/time/boolean fields do not
work.

On Apr 4, 10:37 am, "David J."  wrote:
> Thanks Massimo;
>
> I never thought to even try this;
> I will make a sample project and test this;
> (For me the other way works; so I wouldn't ask that you implement it in
> DAL; (but I am happy to test it;)
>
> Thanks for your great software.
>
> David.
>
> On 4/4/11 9:24 AM, Massimo Di Pierro wrote:
>
>
>
>
>
>
>
> > DAL allows to do:
>
> > db=DAL('mongodb://127.0.0.1:5984/db')
>
> > it allows to define_table and allows db.table.insert(...) other
> > methods have not been implemented because the above was never tested.
> > If you help us with testing I can implement the other methods (select,
> > count, update).
>
> > On Apr 1, 9:55 am, "David J."  wrote:
> >> While DAL might not support MongDB; you can still use it via mongoengine;
>
> >> On 4/1/11 10:41 AM, Marcel Luethi wrote:
>
> >>> Despite a lot of time, I'd like to help as well.
> >>> MongoDB looks promising.
> >>> On 1 Apr., 04:58, Massimo Di Pierro
> >>> wrote:
>  Lots of people asked for support but nobody volunteered to help test
>  it.
>  If you are interested and can help with some regular tests we can make
>  it work in relatively short time.
>  Massimo
>  On Mar 31, 9:09 pm, luckysmack    wrote:
> > I have read a few older messages about mongoDB being made to work with
> > the DAL. But they all seem to be pretty dated and have not specified
> > what was working and what wasnt. massimo menitoned that it may be
> > ready by january of this year. But under the supported list it wasnt
> > listed. So im just curious as to what the status of using mongoDB is
> > with web2py and if anyone has a basic example on how I would use it.
> > Thanks


[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread Massimo Di Pierro
I too have lots of issues with searching google groups.

On Apr 4, 12:21 pm, mikech  wrote:
> I'd like to see some FAQ topics that can be pointed to on the usual FUD
> about Web2py.  For instance:
>
> In web2py the code you write for the controller layer (views) goes into
> files that are not Python modules because they don't include any imports to
> give context to external identifiers. Web2py loads, compiles, and executes
> those modules at runtime passing a global context using Python's exec()
> function. That strange (and unjustified) way of doing things disables
> important capabilities of modern IDEs (code completion, code hints, help,
> static checking, refactoring) because those files are not Python modules. It
> also makes it very difficult to write unit tests for the controller layer,
> because the global runtime context of web2py cannot be mocked.
>
> I tried to look for the Google thread in which Massimo addressed these and
> other issues, but the search didn't easily retrieve it, and though I knew
> that I had participated in it my profile history only showed posts thru the
> end of 2010.  


[web2py] Re: Web2py version 1.94.6 bug?

2011-04-04 Thread Massimo Di Pierro
I just fixed this in trunk. please remove the .xml(). The wizard is
still experimental and small things like this may still change.
Sorry about the trouble but there were good reasons for this change.

Massimo

On Apr 4, 11:45 am, Christopher Steel  wrote:
> Running the latest version of Web2py and Python 2.7 on OS X  the I get
> the following error when running wizard created applicaitons:
>
> File "/Users/username/webapps/2010_04_04/web2py/applications/a/models/
> menu.py", line 8, in 
>
> (T('Index'),URL('default','index').xml()==URL().xml(),URL('default','index' ),
> []),
>
> AttributeError: 'str' object has no attribute 'xml'


[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread pbreit
Mikech, here's one 
thread: https://groups.google.com/d/topic/web2py/uIYf-dTjd88/discussion

I guess it could be helpful to note that the framework design may impede 
certain development aspects such as IDE code-completion. "unjustified" is 
unjustified as the justification has been published several times and makes 
sense.

Massimo, kind of a snarky, unhelpful response.


[web2py] components and args

2011-04-04 Thread Richard Vézina
Hello,

It seems that I have to modified completly my app to make it work with
components, I would just like to confirm it...

Here a my url : myapp/mycontroller/myfunction/mytable or args 0

When I try

{{=LOAD(c='mycontroller',f='myfunction',args='mytable',extension='.load',ajax=True)}}

It keeps loading... for ever.

It seems that if ".load" is not applied to myfunction.load it can't work...
If I try : myfunction.load and args=mytable noting better happen.

Thanks

Richard


[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread pbreit
Also, there are options for what you are looking for:
http://wingware.com/doc/howtos/web2py


Re: [web2py] Re: 1.94.6 site-packages

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 11:03 AM, Massimo Di Pierro wrote:
> 
> Problem is mercurial does not version control empty folder. It should
> have been created at startup. Was it not?

We put __init__.py (otherwise unnecessary) in site-packages partly to fix that, 
I thought. Maybe that doesn't work because __init__.py is empty too?

> 
> On Apr 4, 9:46 am, Will Stevens  wrote:
>> I just wanted to point out that the 'site-packages' directory is
>> missing in the source download of the 1.94.6 version.
>> 
>> I added the directory in my project and added back in my libs and
>> everything is working.  It just looks like the empty directory was
>> left out in this last version.
>> 
>> Cheers...




Re: [web2py] components and args

2011-04-04 Thread Anthony
I'm not sure if this is your only problem, but isn't it supposed to be 
extension='load' rather than extension='.load'? Also, have you actually 
created a 'myfunction.load' view file (inside the /views/mycontroller/ 
folder)? If not, web2py should attempt to use the 'generic.load' view.
 
Anthony

On Monday, April 4, 2011 2:46:53 PM UTC-4, Richard wrote:

> Hello, 
>
>  It seems that I have to modified completly my app to make it work with 
> components, I would just like to confirm it...
>
> Here a my url : myapp/mycontroller/myfunction/mytable or args 0
>
> When I try 
>
>
> {{=LOAD(c='mycontroller',f='myfunction',args='mytable',extension='.load',ajax=True)}}
>
> It keeps loading... for ever.
>
> It seems that if ".load" is not applied to myfunction.load it can't work... 
> If I try : myfunction.load and args=mytable noting better happen.
>
> Thanks
>
> Richard
>


Re: [web2py] Re: PDF writing under GAE

2011-04-04 Thread howesc
hopefully not a red herring, but google gave us gifts last week, one of them 
was file "reading" and "writing" from the blobstore: 
http://googleappengine.blogspot.com/2011/03/announcing-app-engine-143-release_30.html

i have not looked at how to connect things to it, but might help here.

cfh


[web2py] Re: url rewriting

2011-04-04 Thread Shark
can you help me by writing an  example  ?

Thanks

On Apr 4, 4:25 pm, Jonathan Lundell  wrote:
> On Apr 4, 2011, at 5:02 AM, Ahmed Sharkawy wrote:
>
> > I use GAE and I use the app.yaml to solve this
> > but there is anther problem
> > I have more than one function in the file so I want to point to the 
> > specific function
>
> > the code in app.yaml is
> > - url: /login
> >   script: applications\init\controllers\login.py
>
> I don't think this can work. The stock web2py app.yaml routes all web2py 
> requests like this:
>
> - url: .*
>   script: gaehandler.py
>   secure: optional
>
> ...where gaehandler.py is the gateway script, as it were, to web2py in a GAE 
> environment.
>
>
>
> > but if I have a script contain 2 functions how to point to one of them ?
>
> web2py will pick out the right function from the URL, but you have to go 
> through the handler. Use routes.py to shorten the URLs if you need to.
>
> > Thanks for your patience and your ideas
>
> > On 3 April 2011 23:38, Jonathan Lundell  wrote:
> > On Apr 3, 2011, at 2:22 PM, pbreit wrote:
>
> > > Oh right, cuz login is going to be /user/login ?
>
> > Well, that too, but simply setting default_application (without any 
> > routing) will never suppress the application unless it's also suppressing 
> > the controller and function.


Re: [web2py] Re: url rewriting

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 12:50 PM, Shark wrote:
> 
> can you help me by writing an  example  ?

Sure. Just copy router.example.py to routes.py, and change the 
default_application (in the BASE router) from "welcome" to "init".

> 
> Thanks
> 
> On Apr 4, 4:25 pm, Jonathan Lundell  wrote:
>> On Apr 4, 2011, at 5:02 AM, Ahmed Sharkawy wrote:
>> 
>>> I use GAE and I use the app.yaml to solve this
>>> but there is anther problem
>>> I have more than one function in the file so I want to point to the 
>>> specific function
>> 
>>> the code in app.yaml is
>>> - url: /login
>>>   script: applications\init\controllers\login.py
>> 
>> I don't think this can work. The stock web2py app.yaml routes all web2py 
>> requests like this:
>> 
>> - url: .*
>>   script: gaehandler.py
>>   secure: optional
>> 
>> ...where gaehandler.py is the gateway script, as it were, to web2py in a GAE 
>> environment.
>> 
>> 
>> 
>>> but if I have a script contain 2 functions how to point to one of them ?
>> 
>> web2py will pick out the right function from the URL, but you have to go 
>> through the handler. Use routes.py to shorten the URLs if you need to.
>> 
>>> Thanks for your patience and your ideas
>> 
>>> On 3 April 2011 23:38, Jonathan Lundell  wrote:
>>> On Apr 3, 2011, at 2:22 PM, pbreit wrote:
>> 
 Oh right, cuz login is going to be /user/login ?
>> 
>>> Well, that too, but simply setting default_application (without any 
>>> routing) will never suppress the application unless it's also suppressing 
>>> the controller and function.




[web2py] New Slice: Create a Form Wizard

2011-04-04 Thread Bruno Rocha
I Just forked a post[0] in to a slice[1]

[0] http://motanet.com.br/python/form-wizard-com-web2py/

[1] http://web2pyslices.com/main/slices/take_slice/127



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]


Re: [web2py] components and args

2011-04-04 Thread Richard Vézina
Hello Anthony,

I have no problem using generic.load view for now...

My problem is mostly related to the fact I use table name as args in my url
and without args 0 my function can't do anything...

That why I tried with extension='.load'

Here some code :


## CONTROLLER :
@auth.requires_login()
def create():
if request.args(0) in ref_tables_list:
redirection_argument=request.args(0)
if en_ui_tables_names[request.args(0)]!=None :
table_name = str.lower(en_ui_tables_names[request.args(0)])
else:
table_name = request.args(0).replace('ref_','')
page_title=T('Form for : ')
if auth.has_membership(auth.id_group('admin')):
crud.settings.formstyle='divs'
form = crud.create(db[request.args(0)])
elif auth.has_membership(auth.id_group('user1')):
crud.settings.formstyle='divs'
form = crud.create(db[request.args(0)])
elif auth.has_membership(auth.id_group('user2')):
crud.settings.formstyle='divs'
form = crud.create(db[request.args(0)])
else:
return
dict(form=None,page_title=page_title,table_name=table_name,\
not_allow_permission='you are not allow
(permission)',permission_denied='Permission denied')
if form.accepts(request.vars, session):
response.flash = T('form accepted')
redirect(URL(r=request, f='read/'+redirection_argument,args=
form.vars.id))
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please fill out the form')
return dict(form=form,page_title=page_title,table_name=table_name,\
not_allow_permission=None,permission_denied=None)
else:
redirect(URL(request.application,'default','index'))
session.flash = T('invalid request')


## VIEW :
{{extend 'layout.html'}}


@import
"{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundle/themes/base/jquery.ui.all.css')}}";

@import
"{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundle/demos/demos.css')}}";












$(function() {
$( "#tabs" ).tabs();
});







{{=T('folder').capitalize()}}
{{=T('volume').capitalize()}}
{{=T('tome').capitalize()}}
{{=T('report').capitalize()}}


{{if form!=None:}}
{{=page_title}} {{=T(table_name)}}

{{=form}}
{{else:}}
{{=permission_denied}}

{{=not_allow_permission}}
{{pass}}
{{pass}}


test2


test3



 {{=LOAD(c='ref',f='create',args='ref_eregistry',extension='.load',ajax=True)}}






Thanks for your help.

Richard

On Mon, Apr 4, 2011 at 3:08 PM, Anthony  wrote:

> I'm not sure if this is your only problem, but isn't it supposed to be
> extension='load' rather than extension='.load'? Also, have you actually
> created a 'myfunction.load' view file (inside the /views/mycontroller/
> folder)? If not, web2py should attempt to use the 'generic.load' view.
>
> Anthony
>
> On Monday, April 4, 2011 2:46:53 PM UTC-4, Richard wrote:
>
>> Hello,
>>
>>  It seems that I have to modified completly my app to make it work with
>> components, I would just like to confirm it...
>>
>> Here a my url : myapp/mycontroller/myfunction/mytable or args 0
>>
>> When I try
>>
>>
>> {{=LOAD(c='mycontroller',f='myfunction',args='mytable',extension='.load',ajax=True)}}
>>
>> It keeps loading... for ever.
>>
>> It seems that if ".load" is not applied to myfunction.load it can't
>> work... If I try : myfunction.load and args=mytable noting better happen.
>>
>> Thanks
>>
>> Richard
>>
>


Re: [web2py] url rewriting

2011-04-04 Thread Bruno Rocha
I dont if it helps, but I use the autoroutes which works very fine for me:

http://snipt.net/rochacbruno/routesconf

http://snipt.net/rochacbruno/routespy


--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]



On Sun, Apr 3, 2011 at 1:01 PM, Shark  wrote:

> Hello
>
> I am asking about url rewriting in web2py withGAE
>
> I want to make our site page
> www.site.com/init/login
>
> to
>
> www.site,com/login
>
> can you help me ?
>
> someone tell me change app,yaml
> others
> say change routers.py
>
> so I need your help
>
> Thanks


Re: [web2py] New Slice: Create a Form Wizard

2011-04-04 Thread David J.

Just one issue;

On step 2 it asks for email again;

But email was already filled in...

But the data is not in the form;

Either the filed should be removed or the data should be there;

The data does appear if you submit the form even if it is blank.



On 4/4/11 4:06 PM, Bruno Rocha wrote:


I Just forked a post[0] in to a slice[1]

[0] http://motanet.com.br/python/form-wizard-com-web2py/

[1] http://web2pyslices.com/main/slices/take_slice/127



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]





Re: [web2py] components and args

2011-04-04 Thread Richard Vézina
.load or load doesn't change anything... I noted the proper syntax.

Richard

On Mon, Apr 4, 2011 at 3:08 PM, Anthony  wrote:

> I'm not sure if this is your only problem, but isn't it supposed to be
> extension='load' rather than extension='.load'? Also, have you actually
> created a 'myfunction.load' view file (inside the /views/mycontroller/
> folder)? If not, web2py should attempt to use the 'generic.load' view.
>
> Anthony
>
> On Monday, April 4, 2011 2:46:53 PM UTC-4, Richard wrote:
>
>> Hello,
>>
>>  It seems that I have to modified completly my app to make it work with
>> components, I would just like to confirm it...
>>
>> Here a my url : myapp/mycontroller/myfunction/mytable or args 0
>>
>> When I try
>>
>>
>> {{=LOAD(c='mycontroller',f='myfunction',args='mytable',extension='.load',ajax=True)}}
>>
>> It keeps loading... for ever.
>>
>> It seems that if ".load" is not applied to myfunction.load it can't
>> work... If I try : myfunction.load and args=mytable noting better happen.
>>
>> Thanks
>>
>> Richard
>>
>


[web2py] problems with python 2.6 (i think)

2011-04-04 Thread pk
hi together,

on my local system (i use python 2.5) all works fine.
but since i installed my app on the webserver (python 2.6.6)
i get the follow error:

88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
Version
web2py™ Version 1.94.6 (2011-03-27 18:20:38)
Python  Python 2.6.6: /usr/bin/python2.6

Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
ccode = compile2(code,layer)
  File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
'exec')
  File "/var/www/web2py/applications/Kundenportal/views/bewertung/
mitarbeiter.html", line 58

SyntaxError: keyword argument repeated

have somebody an idea what i have to do now?
thanks for your help!

peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread Massimo Di Pierro
This looks like a user error something like

f(a=1,a=2)

look into the ticket for line 58 of /var/www/web2py/applications/
Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py

On Apr 4, 3:47 pm, pk  wrote:
> hi together,
>
> on my local system (i use python 2.5) all works fine.
> but since i installed my app on the webserver (python 2.6.6)
> i get the follow error:
>
> 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> Version
> web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> Python  Python 2.6.6: /usr/bin/python2.6
>
> Traceback (most recent call last):
>   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
>     ccode = compile2(code,layer)
>   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
>     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> 'exec')
>   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> mitarbeiter.html", line 58
>     
> SyntaxError: keyword argument repeated
>
> have somebody an idea what i have to do now?
> thanks for your help!
>
> peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
hmmm, but i some blogs the people means, that should be a bug in
python 2.6.

this is my code (line 58):









On 4 Apr., 22:53, Massimo Di Pierro 
wrote:
> This looks like a user error something like
>
> f(a=1,a=2)
>
> look into the ticket for line 58 of /var/www/web2py/applications/
> Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> On Apr 4, 3:47 pm, pk  wrote:
>
>
>
>
>
>
>
> > hi together,
>
> > on my local system (i use python 2.5) all works fine.
> > but since i installed my app on the webserver (python 2.6.6)
> > i get the follow error:
>
> > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > Version
> > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > Python  Python 2.6.6: /usr/bin/python2.6
>
> > Traceback (most recent call last):
> >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> >     ccode = compile2(code,layer)
> >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > 'exec')
> >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > mitarbeiter.html", line 58
> >     
> > SyntaxError: keyword argument repeated
>
> > have somebody an idea what i have to do now?
> > thanks for your help!
>
> > peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
here is a link of the bug:
http://bugs.python.org/issue3219



On 4 Apr., 23:00, pk  wrote:
> hmmm, but i some blogs the people means, that should be a bug in
> python 2.6.
>
> this is my code (line 58):
>
> 
>     
>     
> 
>
> On 4 Apr., 22:53, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > This looks like a user error something like
>
> > f(a=1,a=2)
>
> > look into the ticket for line 58 of /var/www/web2py/applications/
> > Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> > On Apr 4, 3:47 pm, pk  wrote:
>
> > > hi together,
>
> > > on my local system (i use python 2.5) all works fine.
> > > but since i installed my app on the webserver (python 2.6.6)
> > > i get the follow error:
>
> > > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > > Version
> > > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > > Python  Python 2.6.6: /usr/bin/python2.6
>
> > > Traceback (most recent call last):
> > >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> > >     ccode = compile2(code,layer)
> > >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> > >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > > 'exec')
> > >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > > mitarbeiter.html", line 58
> > >     
> > > SyntaxError: keyword argument repeated
>
> > > have somebody an idea what i have to do now?
> > > thanks for your help!
>
> > > peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
my view:


   
   

{{for angestellte in mitarbeiter:}}
   
   
   
{{pass}}

On 4 Apr., 23:00, pk  wrote:
> here is a link of the bug:http://bugs.python.org/issue3219
>
> On 4 Apr., 23:00, pk  wrote:
>
>
>
>
>
>
>
> > hmmm, but i some blogs the people means, that should be a bug in
> > python 2.6.
>
> > this is my code (line 58):
>
> > 
> >     
> >     
> > 
>
> > On 4 Apr., 22:53, Massimo Di Pierro 
> > wrote:
>
> > > This looks like a user error something like
>
> > > f(a=1,a=2)
>
> > > look into the ticket for line 58 of /var/www/web2py/applications/
> > > Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> > > On Apr 4, 3:47 pm, pk  wrote:
>
> > > > hi together,
>
> > > > on my local system (i use python 2.5) all works fine.
> > > > but since i installed my app on the webserver (python 2.6.6)
> > > > i get the follow error:
>
> > > > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > > > Version
> > > > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > > > Python  Python 2.6.6: /usr/bin/python2.6
>
> > > > Traceback (most recent call last):
> > > >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> > > >     ccode = compile2(code,layer)
> > > >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> > > >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > > > 'exec')
> > > >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > > > mitarbeiter.html", line 58
> > > >     
> > > > SyntaxError: keyword argument repeated
>
> > > > have somebody an idea what i have to do now?
> > > > thanks for your help!
>
> > > > peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
hi massimo,

but if it is a user error, why it works fine on my local system???

peter

On 4 Apr., 23:04, pk  wrote:
> my view:
>
> 
>    
>    
> 
> {{for angestellte in mitarbeiter:}}
>    
>     src="{{=URL(r=request,f='download',args=[angestellte.picture])}}"
>    alt="" class="i-portfolio p-left"/>
>    
> {{pass}}
>
> On 4 Apr., 23:00, pk  wrote:
>
>
>
>
>
>
>
> > here is a link of the bug:http://bugs.python.org/issue3219
>
> > On 4 Apr., 23:00, pk  wrote:
>
> > > hmmm, but i some blogs the people means, that should be a bug in
> > > python 2.6.
>
> > > this is my code (line 58):
>
> > > 
> > >     
> > >     
> > > 
>
> > > On 4 Apr., 22:53, Massimo Di Pierro 
> > > wrote:
>
> > > > This looks like a user error something like
>
> > > > f(a=1,a=2)
>
> > > > look into the ticket for line 58 of /var/www/web2py/applications/
> > > > Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> > > > On Apr 4, 3:47 pm, pk  wrote:
>
> > > > > hi together,
>
> > > > > on my local system (i use python 2.5) all works fine.
> > > > > but since i installed my app on the webserver (python 2.6.6)
> > > > > i get the follow error:
>
> > > > > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > > > > Version
> > > > > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > > > > Python  Python 2.6.6: /usr/bin/python2.6
>
> > > > > Traceback (most recent call last):
> > > > >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> > > > >     ccode = compile2(code,layer)
> > > > >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> > > > >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > > > > 'exec')
> > > > >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > > > > mitarbeiter.html", line 58
> > > > >     
> > > > > SyntaxError: keyword argument repeated
>
> > > > > have somebody an idea what i have to do now?
> > > > > thanks for your help!
>
> > > > > peter


Re: [web2py] url rewriting

2011-04-04 Thread Ahmed Sharkawy
*@*Bruno Rocha *

t is very good site but the answer is so complicated !*

On 4 April 2011 22:13, Bruno Rocha  wrote:

> I dont if it helps, but I use the autoroutes which works very fine for me:
>
> http://snipt.net/rochacbruno/routesconf
>
> http://snipt.net/rochacbruno/routespy
>
>
> --
> Bruno Rocha
> [ About me: http://zerp.ly/rochacbruno ]
>
>
>
> On Sun, Apr 3, 2011 at 1:01 PM, Shark  wrote:
>
>> Hello
>>
>> I am asking about url rewriting in web2py withGAE
>>
>> I want to make our site page
>> www.site.com/init/login
>>
>> to
>>
>> www.site,com/login
>>
>> can you help me ?
>>
>> someone tell me change app,yaml
>> others
>> say change routers.py
>>
>> so I need your help
>>
>> Thanks
>
>
>


-- 
Ahmed Sharkawy


[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread mikech
Thanks all.  I'm participating in the Linkedin conversation, and trying to 
redirect the questioners to places that these issues have already
been adressed, rather than let the detractor's comments stand.   


Re: [web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 2:04 PM, pk wrote:
> 
> my view:
> 
> 
>   
>   
> 
> {{for angestellte in mitarbeiter:}}
>   
>src="{{=URL(r=request,f='download',args=[angestellte.picture])}}"
>   alt="" class="i-portfolio p-left"/>
>   
> {{pass}}
> 
> On 4 Apr., 23:00, pk  wrote:
>> here is a link of the bug:http://bugs.python.org/issue3219
>> 
>> On 4 Apr., 23:00, pk  wrote:
> 




[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread cjrh
On Apr 4, 7:21 pm, mikech  wrote:
> I'd like to see some FAQ topics that can be pointed to on the usual FUD
> about Web2py.  

Why even bother addressing the FUD?  It is better to let others stew
in their own FUD, while we concentrate on writing awesome
applications.  This has always been my view.   FUD is the problem of
those that produce it.  It is not my problem what others may say.  The
fact of the matter is that web2py does a lot of work for the
programmer.   The proof is in the pudding as they say.  People like
myself who build web apps do not find detriment in the design
decisions of web2py.  So why should we care what people from the other
frameworks are saying?  We know our own mind.


Re: [web2py] New Slice: Create a Form Wizard

2011-04-04 Thread Bruno Rocha
I tested here without problems,

at the step2 all fields are in the form, but in the view we show just 2
fields.

I dont understand the issue..


--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]


Re: [web2py] url rewriting

2011-04-04 Thread Bruno Rocha
at the web2py root folde I just created a file called routes.conf with this

http://snipt.net/rochacbruno/routesconf  (replace my domain with your domain
and application)

at the web2py root folder create a file calles routes.py with:

http://snipt.net/rochacbruno/routespy


Restart web2py and www.yourdomain/app/default/index will be
www.yourdomain.com/index


On Mon, Apr 4, 2011 at 6:09 PM, Ahmed Sharkawy  wrote:

> *@*Bruno Rocha *
>
> t is very good site but the answer is so complicated !*
>
>
> On 4 April 2011 22:13, Bruno Rocha  wrote:
>
>> I dont if it helps, but I use the autoroutes which works very fine for me:
>>
>> http://snipt.net/rochacbruno/routesconf
>>
>> http://snipt.net/rochacbruno/routespy
>>
>>
>> --
>> Bruno Rocha
>> [ About me: http://zerp.ly/rochacbruno ]
>>
>>
>>
>> On Sun, Apr 3, 2011 at 1:01 PM, Shark  wrote:
>>
>>>  Hello
>>>
>>> I am asking about url rewriting in web2py withGAE
>>>
>>> I want to make our site page
>>> www.site.com/init/login
>>>
>>> to
>>>
>>> www.site,com/login
>>>
>>> can you help me ?
>>>
>>> someone tell me change app,yaml
>>> others
>>> say change routers.py
>>>
>>> so I need your help
>>>
>>> Thanks
>>
>>
>>
>
>
> --
> Ahmed Sharkawy
>
>


[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread mikech
Agreed.  Really can't argue with your point.   And, anyone who is serious 
enough about researching their options would find out 
that these issues are never mentioned in this group, except when they are 
made by people unfamiliar with the framework.  So, 
they are either non-issues or we're all involved with a huge Web2py 
conspiracy :)  That being said, it may be the care bear in me
but I like the idea of leaving hints for those who are asking the questions. 
 




[web2py] Re: FAQ topic(s) on typical Web2py FUD

2011-04-04 Thread ron_m
Agreed, I looked at all the usual suspects for a Python framework and came 
to the conclusion web2py was the best integrated of any and represented the 
path of least resistance to getting work done with well chosen defaults in 
the design and a well defined way of implementing applications. The admin 
functions helped a lot as well. Nothing since starting to work with web2py 
has changed my mind on the choice I made. I spent years in the land of Java 
before this so am familiar with working with databases from using an ORM 
down to writing my own SQL in JDBC. I like the DAL, close enough to the 
database that you don't lose sight of it in a slew of object mappings but 
far enough away from the drudgery of doing it all by yourself. The layering 
of the controllers and views over top is icing on the cake as they say, no 
reference to CakePHP intended. :-)


Re: [web2py] url rewriting

2011-04-04 Thread Ahmed Sharkawy
*thanks for your answer but I want to change many urls so I think your
script can do so ?!

I want init/account/get to be init/account
init/login/index to be init/login
*
On 4 April 2011 23:20, Bruno Rocha  wrote:

> at the web2py root folde I just created a file called routes.conf with this
>
> http://snipt.net/rochacbruno/routesconf  (replace my domain with your
> domain and application)
>
> at the web2py root folder create a file calles routes.py with:
>
> http://snipt.net/rochacbruno/routespy
>
>
> Restart web2py and www.yourdomain/app/default/index will be
> www.yourdomain.com/index
>
>
>
> On Mon, Apr 4, 2011 at 6:09 PM, Ahmed Sharkawy wrote:
>
>> *@*Bruno Rocha *
>>
>> t is very good site but the answer is so complicated !*
>>
>>
>> On 4 April 2011 22:13, Bruno Rocha  wrote:
>>
>>> I dont if it helps, but I use the autoroutes which works very fine for
>>> me:
>>>
>>> http://snipt.net/rochacbruno/routesconf
>>>
>>> http://snipt.net/rochacbruno/routespy
>>>
>>>
>>> --
>>> Bruno Rocha
>>> [ About me: http://zerp.ly/rochacbruno ]
>>>
>>>
>>>
>>> On Sun, Apr 3, 2011 at 1:01 PM, Shark  wrote:
>>>
  Hello

 I am asking about url rewriting in web2py withGAE

 I want to make our site page
 www.site.com/init/login

 to

 www.site,com/login

 can you help me ?

 someone tell me change app,yaml
 others
 say change routers.py

 so I need your help

 Thanks
>>>
>>>
>>>
>>
>>
>> --
>> Ahmed Sharkawy
>>
>>
>


-- 
Ahmed Sharkawy


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
oh ok i will try it, but why works that fine on my local system??? 8]
it is both the same app / file

On 4 Apr., 23:15, Jonathan Lundell  wrote:
> On Apr 4, 2011, at 2:04 PM, pk wrote:
>
>
>
> > my view:
>
> > 
> >   
> >   
> > 
> > {{for angestellte in mitarbeiter:}}
> >   
> >    > src="{{=URL(r=request,f='download',args=[angestellte.picture])}}"
> >   alt="" class="i-portfolio p-left"/>
> >   
> > {{pass}}
>
> > On 4 Apr., 23:00, pk  wrote:
> >> here is a link of the bug:http://bugs.python.org/issue3219
>
> >> On 4 Apr., 23:00, pk  wrote:


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
ok now it works fine ;)
thanks for your help!!!

peter

On 4 Apr., 23:15, Jonathan Lundell  wrote:
> On Apr 4, 2011, at 2:04 PM, pk wrote:
>
>
>
> > my view:
>
> > 
> >   
> >   
> > 
> > {{for angestellte in mitarbeiter:}}
> >   
> >    > src="{{=URL(r=request,f='download',args=[angestellte.picture])}}"
> >   alt="" class="i-portfolio p-left"/>
> >   
> > {{pass}}
>
> > On 4 Apr., 23:00, pk  wrote:
> >> here is a link of the bug:http://bugs.python.org/issue3219
>
> >> On 4 Apr., 23:00, pk  wrote:


Re: [web2py] url rewriting

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 2:50 PM, Ahmed Sharkawy wrote:
> thanks for your answer but I want to change many urls so I think your script 
> can do so ?!
> 
> I want init/account/get to be init/account
> init/login/index to be init/login

You'll find it easier if you make the default function in each controller have 
the same name. For example, init/account/index instead of init/account/get, in 
your example.

> 
> On 4 April 2011 23:20, Bruno Rocha  wrote:
> at the web2py root folde I just created a file called routes.conf with this
> 
> http://snipt.net/rochacbruno/routesconf  (replace my domain with your domain 
> and application)
> 
> at the web2py root folder create a file calles routes.py with:
> 
> http://snipt.net/rochacbruno/routespy
> 
> 
> Restart web2py and www.yourdomain/app/default/index will be 
> www.yourdomain.com/index
> 
> 
> 
> On Mon, Apr 4, 2011 at 6:09 PM, Ahmed Sharkawy  wrote:
> @Bruno Rocha 
> 
> t is very good site but the answer is so complicated !
> 
> 
> 
> On 4 April 2011 22:13, Bruno Rocha  wrote:
> I dont if it helps, but I use the autoroutes which works very fine for me:
> 
> http://snipt.net/rochacbruno/routesconf
> 
> http://snipt.net/rochacbruno/routespy
> 
> 
> --
> Bruno Rocha
> [ About me: http://zerp.ly/rochacbruno ]
> 
> 
> 
> On Sun, Apr 3, 2011 at 1:01 PM, Shark  wrote:
> Hello
> 
> I am asking about url rewriting in web2py withGAE 
> 
> I want to make our site page 
> www.site.com/init/login 
> 
> to 
> 
> www.site,com/login 
> 
> can you help me ? 
> 
> someone tell me change app,yaml 
> others
> say change routers.py
> 
> so I need your help 
> 
> Thanks
> 
> 
> 
> 
> -- 
> Ahmed Sharkawy
> 
> 





Re: [web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread Jonathan Lundell
On Apr 4, 2011, at 2:54 PM, pk wrote:
> 
> oh ok i will try it, but why works that fine on my local system??? 8]
> it is both the same app / file

The Python bug you linked to was that some versions did *not* give the error 
you're getting. Fixed in 2.6.

> 
> On 4 Apr., 23:15, Jonathan Lundell  wrote:
>> On Apr 4, 2011, at 2:04 PM, pk wrote:
>> 
>> 
>> 
>>> my view:
>> 
>>> 
>>>   
>>>   
>>> 
>>> {{for angestellte in mitarbeiter:}}
>>>   
>>>   >> src="{{=URL(r=request,f='download',args=[angestellte.picture])}}"
>>>   alt="" class="i-portfolio p-left"/>
>>>   
>>> {{pass}}
>> 
>>> On 4 Apr., 23:00, pk  wrote:
 here is a link of the bug:http://bugs.python.org/issue3219
>> 
 On 4 Apr., 23:00, pk  wrote:




[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread Mathew Grabau
The way that I read that bug report, the problem is that it is an
error in Python 2.5 that it works; the (at the time) beta of Python
2.6 was patched to make it fail.

The behaviour that you are witnessing is therefore correct (and it
makes sense - why should you give two values to the same keyword
argument and get away with it).


On Apr 4, 4:00 pm, pk  wrote:
> here is a link of the bug:http://bugs.python.org/issue3219
>
> On 4 Apr., 23:00, pk  wrote:
>
>
>
>
>
>
>
> > hmmm, but i some blogs the people means, that should be a bug in
> > python 2.6.
>
> > this is my code (line 58):
>
> > 
> >     
> >     
> > 
>
> > On 4 Apr., 22:53, Massimo Di Pierro 
> > wrote:
>
> > > This looks like a user error something like
>
> > > f(a=1,a=2)
>
> > > look into the ticket for line 58 of /var/www/web2py/applications/
> > > Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> > > On Apr 4, 3:47 pm, pk  wrote:
>
> > > > hi together,
>
> > > > on my local system (i use python 2.5) all works fine.
> > > > but since i installed my app on the webserver (python 2.6.6)
> > > > i get the follow error:
>
> > > > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > > > Version
> > > > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > > > Python  Python 2.6.6: /usr/bin/python2.6
>
> > > > Traceback (most recent call last):
> > > >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> > > >     ccode = compile2(code,layer)
> > > >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> > > >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > > > 'exec')
> > > >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > > > mitarbeiter.html", line 58
> > > >     
> > > > SyntaxError: keyword argument repeated
>
> > > > have somebody an idea what i have to do now?
> > > > thanks for your help!
>
> > > > peter


[web2py] Re: problems with python 2.6 (i think)

2011-04-04 Thread pk
ok that makes sense! thank you guys ;) you are great!
peter

On 5 Apr., 00:01, Mathew Grabau  wrote:
> The way that I read that bug report, the problem is that it is an
> error in Python 2.5 that it works; the (at the time) beta of Python
> 2.6 was patched to make it fail.
>
> The behaviour that you are witnessing is therefore correct (and it
> makes sense - why should you give two values to the same keyword
> argument and get away with it).
>
> On Apr 4, 4:00 pm, pk  wrote:
>
>
>
>
>
>
>
> > here is a link of the bug:http://bugs.python.org/issue3219
>
> > On 4 Apr., 23:00, pk  wrote:
>
> > > hmmm, but i some blogs the people means, that should be a bug in
> > > python 2.6.
>
> > > this is my code (line 58):
>
> > > 
> > >     
> > >     
> > > 
>
> > > On 4 Apr., 22:53, Massimo Di Pierro 
> > > wrote:
>
> > > > This looks like a user error something like
>
> > > > f(a=1,a=2)
>
> > > > look into the ticket for line 58 of /var/www/web2py/applications/
> > > > Kundenportal/views/bewertung/mitarbeiter.html after conversion to .py
>
> > > > On Apr 4, 3:47 pm, pk  wrote:
>
> > > > > hi together,
>
> > > > > on my local system (i use python 2.5) all works fine.
> > > > > but since i installed my app on the webserver (python 2.6.6)
> > > > > i get the follow error:
>
> > > > > 88.64.63.144.2011-04-04.21-57-50.b68db5d8-aa6c-497c-93f4-f596f726dbc4
> > > > > Version
> > > > > web2py™       Version 1.94.6 (2011-03-27 18:20:38)
> > > > > Python  Python 2.6.6: /usr/bin/python2.6
>
> > > > > Traceback (most recent call last):
> > > > >   File "/var/www/web2py/gluon/restricted.py", line 186, in restricted
> > > > >     ccode = compile2(code,layer)
> > > > >   File "/var/www/web2py/gluon/restricted.py", line 173, in compile2
> > > > >     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> > > > > 'exec')
> > > > >   File "/var/www/web2py/applications/Kundenportal/views/bewertung/
> > > > > mitarbeiter.html", line 58
> > > > >     
> > > > > SyntaxError: keyword argument repeated
>
> > > > > have somebody an idea what i have to do now?
> > > > > thanks for your help!
>
> > > > > peter


  1   2   >