[web2py:38114] Re: LOL

2009-12-30 Thread Jake
Good luck with that

On Dec 30, 11:27 pm, Massimo Di Pierro 
wrote:
> http://london.craigslist.co.uk/stp/1531016430.html

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38113] Re: roadmap?!

2009-12-30 Thread Jake
Here's a link to the wiki for future convenience:

http://code.google.com/p/web2py/w/list

Jake

On Dec 30, 9:42 pm, mdipierro  wrote:
> Here it is. I added a few more desirable plugins. It would be nice if
> people where to take responsibility for some of them so we know who to
> call for help. ;-)
>
> On Dec 30, 8:34 pm, Massimo Di Pierro  wrote:
>
>
>
> > That is a good idea. I will do so.
>
> > Thank you Yarko. We should use the google.code wiki more.
>
> > I also wish you and everybody else a Happy New Year.
>
> > Massimo
>
> > On Dec 30, 2009, at 6:47 PM, Yarko Tymciurak wrote:
>
> > > Hi Massimo:
>
> > > Might I suggest you put "ROADMAP" items on code.google.com/p/web2py  
> > > wiki - this is more appropriate than perhaps anywhere else;  
> > > web2py.com is released, completed stuff;  google code is development  
> > > (and ROADMAP is a development-kind-of-thing).
>
> > > Per-item:
> > > A description and (as possible) definition (perhaps a separate wiki  
> > > page for each, with a target release);
> > > An issue in the issues for each taskable item (there may be more  
> > > than one per roadmap item);
> > > Perhaps a link from web2py.com to the google code wiki with the  
> > > current roadmap.
>
> > > The only problem with this (at the moment) is that you are the only  
> > > one (?) who can update / write this wiki (you should consider adding  
> > > perhaps some of your more trusted students).  For issues, this is no  
> > > problem.  In fact, you could "roll up" feature requests that you  
> > > accept into roadmap items (those that will take longer term work).
>
> > > RE:  plugins:   there are some general issues that need to be  
> > > addressed with plugins (it seems the plugin system is not "complete"  
> > > yet), for example, someone mentioned "how to I create a *.w2p or  
> > > load one of a plugin?" --- very good question.
>
> > > WIshing you a Happy New Year,
>
> > > Yarko
>
> > > On Wed, Dec 30, 2009 at 11:59 AM, mdipierro  
> > >  wrote:
> > > Alvaro said this over and over. We need a roadmap.
>
> > > For me the most important things are:
>
> > > 1) getting the new DAL done (and include support for more NoDB and
> > > Sybase)
>
> > > 2) Create a set of standard and customizable plugins for:
> > >  a) comments (*)
> > >  b) tagging (*)
> > >  c) voting/rating
> > >  d) wiki/versioning
> > >  e) attachements of documents
> > >  f) google checkout (*)
> > >  e) quizzes and surveys (we can take it out from kpax)
> > >  g) autocomplete
> > >  h) embedding media files (photo gallery, video player, etc)
> > >  i) customization of layout (*)
> > > (*) we have some prototyes but not production quality yet.
>
> > > I could use help with these and some of you have demonstrated better
> > > skills than mine on this.
>
> > > 3) merge T4 and kpax to use plugins.
>
> > > 4) Create a portable StringListProperty model type that works without
> > > GAE.
>
> > > 5) Create a widget to display a StringListProperty field.
>
> > > Massimo
>
> > > --
>
> > > You received this message because you are subscribed to the Google  
> > > Groups "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com
> > > .
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en
> > > .

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38112] Database Keywords

2009-12-30 Thread Thadeus Burgess
Can the new DAL have a list of protected keywords for the database and
throw and exception if you try to define a column with the keyword?

-Thadeus

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38111] Send web2py a greeting card - Happy New Year

2009-12-30 Thread mdipierro
http://web2py.com/cards/default/index

you need:
- your latitude
- your longitude
- a photo of you or of your town

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38110] Re: Bug in appadmin view next 100 rows

2009-12-30 Thread Thadeus Burgess
I take that back, this does not solve it, since web2py ends up
reversing the query, so the next 100 rows is actually the next 100
from the end.

-Thadeus





On Wed, Dec 30, 2009 at 11:58 PM, Thadeus Burgess  wrote:
> What I'm trying to do:
>
> Sort by a row (say last_name). Then view the next 100 rows.
>
> What I expect:
>
> For the next 100 to continue with the sorted query
>
> What happens:
>
> The query resets
>
> How to fix it:
>
> I'm sure there is a better way, but the orderby get_vars is being lost
> in the middle... so
>
>    {{=nrows}} {{=T("selected")}}
>    {{if start>0:}}[ {{=A(T('previous 100
> rows'),_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start-100,
> orderby=request.get_vars.orderby)))}} ]{{pass}}
>    {{if stop rows'),_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start+100,
> orderby=request.get_vars.orderby)))}} ]{{pass}}
>    {{if rows:}}
>
> Fixes it in my case. I bet there is a deeper reason as to why web2py
> isn't keeping the correct query in session but I don't have time to
> dive further into this at the moment.
>
> -Thadeus
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38109] Bug in appadmin view next 100 rows

2009-12-30 Thread Thadeus Burgess
What I'm trying to do:

Sort by a row (say last_name). Then view the next 100 rows.

What I expect:

For the next 100 to continue with the sorted query

What happens:

The query resets

How to fix it:

I'm sure there is a better way, but the orderby get_vars is being lost
in the middle... so

{{=nrows}} {{=T("selected")}}
{{if start>0:}}[ {{=A(T('previous 100
rows'),_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start-100,
orderby=request.get_vars.orderby)))}} ]{{pass}}
{{if stophttp://groups.google.com/group/web2py?hl=en.




Re: [web2py:38108] LOL

2009-12-30 Thread Thadeus Burgess
Hey... thats a good idea >.<

-Thadeus





2009/12/30 Zoom.Quiet :
> On Thu, Dec 31, 2009 at 12:27, Massimo Di Pierro
>  wrote:
>> http://london.craigslist.co.uk/stp/1531016430.html
>>
>
> LOL
>
> --
> http://zoomquiet.org 人生苦短? Pythonic!
> 一个人如果力求完善自己,就会看到:为此也必须同时完善他人. 一个人如果不关心别人的完善,自己便不可能完善!
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38107] LOL

2009-12-30 Thread Zoom.Quiet
On Thu, Dec 31, 2009 at 12:27, Massimo Di Pierro
 wrote:
> http://london.craigslist.co.uk/stp/1531016430.html
>

LOL

-- 
http://zoomquiet.org 人生苦短? Pythonic!
一个人如果力求完善自己,就会看到:为此也必须同时完善他人. 一个人如果不关心别人的完善,自己便不可能完善!

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38106] Re: LOL

2009-12-30 Thread weheh
Grin

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38105] Just Take a Time to wish you ALL - HAPPY NEW YEAR 2010 !

2009-12-30 Thread Yannick
I wish you all the best for this new year 2010... A year full of
Health, Wealth, Peace, Joy, Success in all you project... And a lot
more :)

Here is a small e-card I created for fun and host on my web2py small
website...

http://www.onemewebservices.com/onemewish
( This e-card may not be working properly if you are using firefox
version lower than 3.5 sorry for that)


Once again special thanks to Massimo for all he has done for us
through this powerful tool... I'm sure 2010 will be another great year
for Web2py...


Yannick P.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38104] LOL

2009-12-30 Thread Massimo Di Pierro
http://london.craigslist.co.uk/stp/1531016430.html

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38103] Re: Problem with Postgresql DAL

2009-12-30 Thread mdipierro
another option is

qset=db()
if arg1 == "xyz": qset=qset(db.abc.id > 0)
if arg2 == "xyz": qset=qset(db.def.id > 0)
qset.select()

On Dec 30, 9:35 pm, vvk  wrote:
> Sir,
> thanks for the post, seems that I've to re-write all my search
> functions.
>
> 
> varun
>
> On Dec 31, 12:54 am, mdipierro  wrote:
>
> > queries=[]
> > if arg1 == "xyz": queries.append(db.abc.id > 0)
> > if arg2 == "xyz": queries.append(db.def.id > 0)
> > query = reduce(lambda a,b:(a&b),queries)
>
> > On Dec 30, 12:20 pm, vvk  wrote:
>
> > > How to initialize a NULL query
>
> > > My query should be ANDed with various tables depending on arguments I
> > > receive.
>
> > > Like:
> > >     if arg1 == "xyz":
> > >          query = (db.abc.id > 0)
> > >     if arg2 == "xyz":
> > >          query = (db.def.id > 0) & query
>
> > > In my "second if" condition, if "first if" condition is not executed,
> > > error occurs that query is not initialised. How to tackle this ?
>
> > > On Dec 30, 10:51 pm, mdipierro  wrote:
>
> > > > This:
>
> > > > query = (-1)
>
> > > > is not a valid query. The fact it works with sqlite is a miracle.
>
> > > > On Dec 30, 11:43 am, vvk  wrote:
>
> > > > > query = (-1)
> > > > > query = (db.somedb.id > 0) & query
>
> > > > > This querying worked with SQLITE. But it's giving following error with
> > > > > postgres:
>
> > > > > ProgrammingError: argument of AND must be type boolean, not type
> > > > > integer
> > > > > LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> > > > > -1);
>
> > > > > i) I think there is problem with type conversions, is there a way
> > > > > out ?
>
> > > > > ii) Is there a way to initialize a NULL query (like query = (-1) I did
> > > > > earlier ?)
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38102] Re: web2py newbie + google app engine

2009-12-30 Thread mdipierro
I have never seen the first one.
The other two have to do with the fact that the filesystem is
readonly.
We should remove all those unnecessary warning on GAE they just create
confusion.

Massimo

On Dec 30, 9:21 pm, reyelts  wrote:
> Thanks Massimo! That was exactly the problem. I had basic GAE working
> with Python 2.6, so made the rash assumption that the rest of it would
> run safely. I swapped in Python 2.5 and it GAE+web2py runs *much*
> better. It serves out pages as expected, etc. It does come up with a
> couple of warnings:
>
> WARNING  2009-12-29 15:33:57,886 datastore_file_stub.py:483] Could not
> read datastore data from /tmp/dev_appserver.datastore
> WARNING  2009-12-29 15:34:17,456 portalocker.py:91] no file locking
> WARNING  2009-12-29 15:34:19,212 main.py:50] unable to import
> wsgiserver
>
> Are these normal/expected?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38101] Re: Problem with Postgresql DAL

2009-12-30 Thread vvk
Sir,
thanks for the post, seems that I've to re-write all my search
functions.



varun


On Dec 31, 12:54 am, mdipierro  wrote:
> queries=[]
> if arg1 == "xyz": queries.append(db.abc.id > 0)
> if arg2 == "xyz": queries.append(db.def.id > 0)
> query = reduce(lambda a,b:(a&b),queries)
>
> On Dec 30, 12:20 pm, vvk  wrote:
>
> > How to initialize a NULL query
>
> > My query should be ANDed with various tables depending on arguments I
> > receive.
>
> > Like:
> >     if arg1 == "xyz":
> >          query = (db.abc.id > 0)
> >     if arg2 == "xyz":
> >          query = (db.def.id > 0) & query
>
> > In my "second if" condition, if "first if" condition is not executed,
> > error occurs that query is not initialised. How to tackle this ?
>
> > On Dec 30, 10:51 pm, mdipierro  wrote:
>
> > > This:
>
> > > query = (-1)
>
> > > is not a valid query. The fact it works with sqlite is a miracle.
>
> > > On Dec 30, 11:43 am, vvk  wrote:
>
> > > > query = (-1)
> > > > query = (db.somedb.id > 0) & query
>
> > > > This querying worked with SQLITE. But it's giving following error with
> > > > postgres:
>
> > > > ProgrammingError: argument of AND must be type boolean, not type
> > > > integer
> > > > LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> > > > -1);
>
> > > > i) I think there is problem with type conversions, is there a way
> > > > out ?
>
> > > > ii) Is there a way to initialize a NULL query (like query = (-1) I did
> > > > earlier ?)

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38100] Re: web2py newbie + google app engine

2009-12-30 Thread reyelts
Thanks Massimo! That was exactly the problem. I had basic GAE working
with Python 2.6, so made the rash assumption that the rest of it would
run safely. I swapped in Python 2.5 and it GAE+web2py runs *much*
better. It serves out pages as expected, etc. It does come up with a
couple of warnings:

WARNING  2009-12-29 15:33:57,886 datastore_file_stub.py:483] Could not
read datastore data from /tmp/dev_appserver.datastore
WARNING  2009-12-29 15:34:17,456 portalocker.py:91] no file locking
WARNING  2009-12-29 15:34:19,212 main.py:50] unable to import
wsgiserver

Are these normal/expected?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38099] Re: roadmap?!

2009-12-30 Thread mdipierro
Here it is. I added a few more desirable plugins. It would be nice if
people where to take responsibility for some of them so we know who to
call for help. ;-)

On Dec 30, 8:34 pm, Massimo Di Pierro  wrote:
> That is a good idea. I will do so.
>
> Thank you Yarko. We should use the google.code wiki more.
>
> I also wish you and everybody else a Happy New Year.
>
> Massimo
>
> On Dec 30, 2009, at 6:47 PM, Yarko Tymciurak wrote:
>
> > Hi Massimo:
>
> > Might I suggest you put "ROADMAP" items on code.google.com/p/web2py  
> > wiki - this is more appropriate than perhaps anywhere else;  
> > web2py.com is released, completed stuff;  google code is development  
> > (and ROADMAP is a development-kind-of-thing).
>
> > Per-item:
> > A description and (as possible) definition (perhaps a separate wiki  
> > page for each, with a target release);
> > An issue in the issues for each taskable item (there may be more  
> > than one per roadmap item);
> > Perhaps a link from web2py.com to the google code wiki with the  
> > current roadmap.
>
> > The only problem with this (at the moment) is that you are the only  
> > one (?) who can update / write this wiki (you should consider adding  
> > perhaps some of your more trusted students).  For issues, this is no  
> > problem.  In fact, you could "roll up" feature requests that you  
> > accept into roadmap items (those that will take longer term work).
>
> > RE:  plugins:   there are some general issues that need to be  
> > addressed with plugins (it seems the plugin system is not "complete"  
> > yet), for example, someone mentioned "how to I create a *.w2p or  
> > load one of a plugin?" --- very good question.
>
> > WIshing you a Happy New Year,
>
> > Yarko
>
> > On Wed, Dec 30, 2009 at 11:59 AM, mdipierro  
> >  wrote:
> > Alvaro said this over and over. We need a roadmap.
>
> > For me the most important things are:
>
> > 1) getting the new DAL done (and include support for more NoDB and
> > Sybase)
>
> > 2) Create a set of standard and customizable plugins for:
> >  a) comments (*)
> >  b) tagging (*)
> >  c) voting/rating
> >  d) wiki/versioning
> >  e) attachements of documents
> >  f) google checkout (*)
> >  e) quizzes and surveys (we can take it out from kpax)
> >  g) autocomplete
> >  h) embedding media files (photo gallery, video player, etc)
> >  i) customization of layout (*)
> > (*) we have some prototyes but not production quality yet.
>
> > I could use help with these and some of you have demonstrated better
> > skills than mine on this.
>
> > 3) merge T4 and kpax to use plugins.
>
> > 4) Create a portable StringListProperty model type that works without
> > GAE.
>
> > 5) Create a widget to display a StringListProperty field.
>
> > Massimo
>
> > --
>
> > You received this message because you are subscribed to the Google  
> > Groups "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en
> > .
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38098] roadmap?!

2009-12-30 Thread Massimo Di Pierro
That is a good idea. I will do so.

Thank you Yarko. We should use the google.code wiki more.

I also wish you and everybody else a Happy New Year.

Massimo

On Dec 30, 2009, at 6:47 PM, Yarko Tymciurak wrote:

> Hi Massimo:
>
> Might I suggest you put "ROADMAP" items on code.google.com/p/web2py   
> wiki - this is more appropriate than perhaps anywhere else;  
> web2py.com is released, completed stuff;  google code is development  
> (and ROADMAP is a development-kind-of-thing).
>
> Per-item:
> A description and (as possible) definition (perhaps a separate wiki  
> page for each, with a target release);
> An issue in the issues for each taskable item (there may be more  
> than one per roadmap item);
> Perhaps a link from web2py.com to the google code wiki with the  
> current roadmap.
>
> The only problem with this (at the moment) is that you are the only  
> one (?) who can update / write this wiki (you should consider adding  
> perhaps some of your more trusted students).  For issues, this is no  
> problem.  In fact, you could "roll up" feature requests that you  
> accept into roadmap items (those that will take longer term work).
>
> RE:  plugins:   there are some general issues that need to be  
> addressed with plugins (it seems the plugin system is not "complete"  
> yet), for example, someone mentioned "how to I create a *.w2p or  
> load one of a plugin?" --- very good question.
>
>
> WIshing you a Happy New Year,
>
> Yarko
>
>
> On Wed, Dec 30, 2009 at 11:59 AM, mdipierro  
>  wrote:
> Alvaro said this over and over. We need a roadmap.
>
> For me the most important things are:
>
> 1) getting the new DAL done (and include support for more NoDB and
> Sybase)
>
> 2) Create a set of standard and customizable plugins for:
>  a) comments (*)
>  b) tagging (*)
>  c) voting/rating
>  d) wiki/versioning
>  e) attachements of documents
>  f) google checkout (*)
>  e) quizzes and surveys (we can take it out from kpax)
>  g) autocomplete
>  h) embedding media files (photo gallery, video player, etc)
>  i) customization of layout (*)
> (*) we have some prototyes but not production quality yet.
>
> I could use help with these and some of you have demonstrated better
> skills than mine on this.
>
> 3) merge T4 and kpax to use plugins.
>
> 4) Create a portable StringListProperty model type that works without
> GAE.
>
> 5) Create a widget to display a StringListProperty field.
>
> Massimo
>
> --
>
> You received this message because you are subscribed to the Google  
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com 
> .
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en 
> .
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38097] roadmap?!

2009-12-30 Thread Massimo Di Pierro
I am not sure if there is one already or not but perhaps we should add  
a roadmap page to the wiki. Could you do it?

On Dec 30, 2009, at 5:29 PM, Alex Fanjul wrote:

> Massimo, with your permission, I would add "Breadcumb" plugin to your
> list. I think Alexander is working on this and he has a working slice
> already.
> Alex F
>
> El 30/12/2009 18:59, mdipierro escribió:
>> Alvaro said this over and over. We need a roadmap.
>>
>> For me the most important things are:
>>
>> 1) getting the new DAL done (and include support for more NoDB and
>> Sybase)
>>
>> 2) Create a set of standard and customizable plugins for:
>>   a) comments (*)
>>   b) tagging (*)
>>   c) voting/rating
>>   d) wiki/versioning
>>   e) attachements of documents
>>   f) google checkout (*)
>>   e) quizzes and surveys (we can take it out from kpax)
>>   g) autocomplete
>>   h) embedding media files (photo gallery, video player, etc)
>>   i) customization of layout (*)
>> (*) we have some prototyes but not production quality yet.
>>
>> I could use help with these and some of you have demonstrated better
>> skills than mine on this.
>>
>> 3) merge T4 and kpax to use plugins.
>>
>> 4) Create a portable StringListProperty model type that works without
>> GAE.
>>
>> 5) Create a widget to display a StringListProperty field.
>>
>> Massimo
>>
>> --
>>
>> You received this message because you are subscribed to the Google  
>> Groups "web2py-users" group.
>> To post to this group, send email to web...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> web2py+unsubscr...@googlegroups.com 
>> .
>> For more options, visit this group at 
>> http://groups.google.com/group/web2py?hl=en 
>> .
>>
>>
>>
>>
>
> -- 
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.com
> www.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38096] Re: How the 'auth.settings.allow_basic_login = True' works like?

2009-12-30 Thread Massimo Di Pierro
No but

http://user%40mail.com:passw...@domain:port/url

may work %40 is the @ escaped. You also have to escape the password.


On Dec 30, 2009, at 5:26 PM, Alex Fanjul wrote:

> http://u...@mail.com:passw...@domain:port/url

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38095] Re: roadmap?!

2009-12-30 Thread mdipierro
please do. I did not add it because I thought it was done. It is an
important one.

On Dec 30, 5:29 pm, Alex Fanjul  wrote:
> Massimo, with your permission, I would add "Breadcumb" plugin to your
> list. I think Alexander is working on this and he has a working slice
> already.
> Alex F
>
> El 30/12/2009 18:59, mdipierro escribi :
>
>
>
> > Alvaro said this over and over. We need a roadmap.
>
> > For me the most important things are:
>
> > 1) getting the new DAL done (and include support for more NoDB and
> > Sybase)
>
> > 2) Create a set of standard and customizable plugins for:
> >    a) comments (*)
> >    b) tagging (*)
> >    c) voting/rating
> >    d) wiki/versioning
> >    e) attachements of documents
> >    f) google checkout (*)
> >    e) quizzes and surveys (we can take it out from kpax)
> >    g) autocomplete
> >    h) embedding media files (photo gallery, video player, etc)
> >    i) customization of layout (*)
> > (*) we have some prototyes but not production quality yet.
>
> > I could use help with these and some of you have demonstrated better
> > skills than mine on this.
>
> > 3) merge T4 and kpax to use plugins.
>
> > 4) Create a portable StringListProperty model type that works without
> > GAE.
>
> > 5) Create a widget to display a StringListProperty field.
>
> > Massimo
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38094] roadmap?!

2009-12-30 Thread Alex Fanjul
Massimo, with your permission, I would add "Breadcumb" plugin to your 
list. I think Alexander is working on this and he has a working slice 
already.
Alex F

El 30/12/2009 18:59, mdipierro escribió:
> Alvaro said this over and over. We need a roadmap.
>
> For me the most important things are:
>
> 1) getting the new DAL done (and include support for more NoDB and
> Sybase)
>
> 2) Create a set of standard and customizable plugins for:
>a) comments (*)
>b) tagging (*)
>c) voting/rating
>d) wiki/versioning
>e) attachements of documents
>f) google checkout (*)
>e) quizzes and surveys (we can take it out from kpax)
>g) autocomplete
>h) embedding media files (photo gallery, video player, etc)
>i) customization of layout (*)
> (*) we have some prototyes but not production quality yet.
>
> I could use help with these and some of you have demonstrated better
> skills than mine on this.
>
> 3) merge T4 and kpax to use plugins.
>
> 4) Create a portable StringListProperty model type that works without
> GAE.
>
> 5) Create a widget to display a StringListProperty field.
>
> Massimo
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38093] Re: How the 'auth.settings.allow_basic_login = True' works like?

2009-12-30 Thread Alex Fanjul
So I guess that is the problem, traying to access url through standard 
way but with email username because it would remain: 
http://u...@mail.com:passw...@domain:port/uri , and I think this won't 
be valid...
alex f

El 30/12/2009 18:06, Massimo Di Pierro escribió:
> It depends. Unless you have custom auth_user table with a username 
> field, your username is the email and that is what you should use in 
> basic auth.
>
> On Dec 30, 2009, at 10:12 AM, Alex Fanjul wrote:
>
>> Massimo I think the username is not an email, is just the standard way
>> of accessing url with basic auth, isn't it?
>> http://  username : password @ domain : port / uri
>>
>> alex
>>
>> El 30/12/2009 15:25, mdipierro escribió:
>>> That probably will not work since it is not what was designed for.
>>> I am not sure why it did not work thou.
>>> If the username is the email, did you escape it?
>>>
>>> On Dec 30, 1:16 am, David Marko  wrote:
>>>
 I simply tried to call the method with URLcontaining the username/
 password. e.g. tttp://username:p...@localhost:8080/  . Its just
 internal call so its fine that username/pwd is in URL. I simply tried
 this in browser, but login form apeared instead.

 David

 On Dec 29, 10:25 pm, mdipierro  wrote:


> The allow basic login allows you to call functions that
> @auth.requires_login() by passing the credential using basic auth for
> example call the url using wget and curl.
>

> How are you using it?
>

> On Dec 29, 2:59 pm, David Marko  wrote:
>

>> How the settings 'auth.settings.allow_basic_login = True' is 
>> supposed
>> to work? I tried to login to protected 
>> method('@auth.requires_login
>> ()') via basic auth, but was not succesfull. Is there some 
>> additional
>> setting for protected methods or '@auth.requires_login()'' is 
>> simply
>> used for both auth ? Can someone explain please?
>>

>> David
>>


>>> -- 
>>>
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To post to this group, send email to web...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> web2py+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/web2py?hl=en.
>>>
>>>
>>>
>>>
>>
>> -- 
>> Alejandro Fanjul Fdez.
>> alex.fan...@gmail.com
>> www.mhproject.org
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38092] Re: New Windows Python IDE

2009-12-30 Thread Mengu
huh, not like the one i have in my mind. good then because i'm going
to write it. :)

On 30 Aralık, 23:06, mikech  wrote:
> http://pfaide.com/

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38091] Re: Cron job at WebFaction

2009-12-30 Thread Andy Pardue
Sorry I have not replied sooner.
the cron job is for apache
When you use wsgi apache runs the web2py.

Andy

On Dec 25, 8:19 am, annet  wrote:
> Andy,
>
> I think your guess is right, to be sure I asked support the same
> question. Here is their answer:
>
> There is a Control Panel installer for 'mod_wsgi 2.5/Python 2.5' - it
> automatically creates a cron job that would start the server, if it is
> not running.
>
> I guess 'the server' refers to web2py? What exactly is a cron job in
> this case?
>
> Kind regards,
>
> Annet.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38090] Re: New Windows Python IDE

2009-12-30 Thread mdipierro
I see it does diagrams of modules. Would you make a few of those
diagrams and send them to me?

Massimo

On Dec 30, 4:16 pm, Andy Pardue  wrote:
> I played with it, and it looks like nothing will replace eric4 for me.
> I have been using eric back in the 3 days for PyQt apps.
> A lot of people poo poo eric because of not getting breakpoints to
> work.
> One can force a breakpoint every time by importing sys on the file and
> inserting sys.breakpoint() where they want it to break.
> Now every time you hit that spot it will break.
> I'm going to look into adding exception catching to eric4 like wing
> for web2py.
>
> On Dec 30, 1:48 pm, mdipierro  wrote:
>
> > Really cool but windows only. :-(
>
> > On Dec 30, 3:06 pm, mikech  wrote:
>
> > >http://pfaide.com/
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38089] Re: New Windows Python IDE

2009-12-30 Thread Andy Pardue
I played with it, and it looks like nothing will replace eric4 for me.
I have been using eric back in the 3 days for PyQt apps.
A lot of people poo poo eric because of not getting breakpoints to
work.
One can force a breakpoint every time by importing sys on the file and
inserting sys.breakpoint() where they want it to break.
Now every time you hit that spot it will break.
I'm going to look into adding exception catching to eric4 like wing
for web2py.


On Dec 30, 1:48 pm, mdipierro  wrote:
> Really cool but windows only. :-(
>
> On Dec 30, 3:06 pm, mikech  wrote:
>
>
>
> >http://pfaide.com/

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38088] 1.74.5 is OUT

2009-12-30 Thread mdipierro
What's new?

- bug fixes
- auth.user_id (shortcut for auth.user.id that defaults to None if not
logged it)
- support for all native types on Google App Engine (for example
StringListProperty)
- restored python 2.4 support,thanks ont.rif
- cache.ram usage statictics, thanks Thadus
- no more auth manu in scaffolding
- no more spash screen with -Q
- fixed doctest in html.py, thanks Anand Vaidya
- export_to_csv_file has represent, thanks Thadeus

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38087] Re: New Windows Python IDE

2009-12-30 Thread mdipierro
Really cool but windows only. :-(

On Dec 30, 3:06 pm, mikech  wrote:
> http://pfaide.com/

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38086] New Windows Python IDE

2009-12-30 Thread mikech
http://pfaide.com/

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38085] roadmap?!

2009-12-30 Thread Jason Brower
I would highly recommend having this on your homepage.  It's important
for developers to see futureplans and what is new between releases.
BR,
Jason
On Wed, 2009-12-30 at 09:59 -0800, mdipierro wrote: 
> Alvaro said this over and over. We need a roadmap.
> 
> For me the most important things are:
> 
> 1) getting the new DAL done (and include support for more NoDB and
> Sybase)
> 
> 2) Create a set of standard and customizable plugins for:
>   a) comments (*)
>   b) tagging (*)
>   c) voting/rating
>   d) wiki/versioning
>   e) attachements of documents
>   f) google checkout (*)
>   e) quizzes and surveys (we can take it out from kpax)
>   g) autocomplete
>   h) embedding media files (photo gallery, video player, etc)
>   i) customization of layout (*)
> (*) we have some prototyes but not production quality yet.
> 
> I could use help with these and some of you have demonstrated better
> skills than mine on this.
> 
> 3) merge T4 and kpax to use plugins.
> 
> 4) Create a portable StringListProperty model type that works without
> GAE.
> 
> 5) Create a widget to display a StringListProperty field.
> 
> Massimo
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
> 
> 


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38084] Re: Two Errors

2009-12-30 Thread mdipierro
1) GAE rules. Here is a quick fix.

posts = db((db.posts.category == cat.id)).select(db.posts.ALL).sort
(lambda r['created'],reverse=True)

2) Try one of these variations

if request.args[0] is u'Programação'
if request.args[0] is unicode('Programação')
if request.args[0] is unicode('Programação').encode('utf8')


On Dec 30, 1:11 pm, Leandro - ProfessionalIT 
wrote:
> Friends,
>   I have two Problems in my blog App (running in GAE).
>   1) In the code that generate the RSS by category:
>      - It's run but only if I don't put the orderby declaration in
> db.select() method but
>      I need to sort my posts by ~created(DESC created) date to
> generate my RSS feeds.
>
>         My RSS function:
>
>         def rss():
>                 import datetime
>                 
> response.headers['Content-Type']='application/rss+xml;charset=utf-8'
>                 import gluon.contrib.rss2 as rss2
>                 try:
>                         cat_name = request.args[0]
>                         if cat_name == 'all':
>                                 cat_name = ''
>                         if cat_name != '' :
>                                 cat = 
> db(db.categories.name==cat_name).select()[0]
>                                 # This code generate a Exception
>                                 #posts = db(
>                                 #                       (db.posts.category == 
> cat.id)
>                                 #                       
> ).select(db.posts.ALL, orderby=~db.posts.created)
>
>                                 # This code run OK.
>                                 posts = db(
>                                                         (db.posts.category == 
> cat.id)
>                                                         ).select(db.posts.ALL)
>
>                         else:
>                                 posts = db().select(db.posts.ALL, 
> orderby=~db.posts.created)
>                 except Exception, e:
>                         raise e
>
>                 more code 
>
>   2) Filter posts by category name with name in Portuguese:
>      - I have a function that show-me the posts in determined
> category,
>      but if the category name is writted with especial characters/
> Latin characters I receive a Exception.
>
>         My posts by category function:
>
>     # If request.args[0] is 'News' run OK
>     # If request.args[0] is 'Programação' I receive a Exception
>         def category():
>         try:
>                 cat_name = request.args[0]
>                 cat = db(db.categories.name==cat_name).select()[0]
>                 recordsby=7
>                 if request.vars.pagina:
>                         page=int(request.vars.pagina)
>                 else:
>                         page=0
>                 totalrecs = len(db((db.posts.category == cat.id)).select
> (db.posts.ALL))
>                 posts = db((db.posts.category == cat.id)).select
> (db.posts.ALL,limitby=(page*recordsby,(page*recordsby)+recordsby))
>                 
> backward=A('Anteriores',_href=URL(r=request,args=[cat_name],vars=dict
> (pagina=page-1))) if page else ''
>                 
> forward=A('Próximos',_href=URL(r=request,args=[cat_name],vars=dict
> (pagina=page+1))) if totalrecs>((page*recordsby)+recordsby) else ''
>                 response.rss_url = "/blog/rss/%s/" % cat_name
>                 return dict(posts = posts,backward=backward,forward=forward)
>         except Exception, e:
>                 raise e
>
> How to resolve this two problems ?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38083] Re: Problem with Postgresql DAL

2009-12-30 Thread mdipierro
queries=[]
if arg1 == "xyz": queries.append(db.abc.id > 0)
if arg2 == "xyz": queries.append(db.def.id > 0)
query = reduce(lambda a,b:(a&b),queries)

On Dec 30, 12:20 pm, vvk  wrote:
> How to initialize a NULL query
>
> My query should be ANDed with various tables depending on arguments I
> receive.
>
> Like:
>     if arg1 == "xyz":
>          query = (db.abc.id > 0)
>     if arg2 == "xyz":
>          query = (db.def.id > 0) & query
>
> In my "second if" condition, if "first if" condition is not executed,
> error occurs that query is not initialised. How to tackle this ?
>
> On Dec 30, 10:51 pm, mdipierro  wrote:
>
> > This:
>
> > query = (-1)
>
> > is not a valid query. The fact it works with sqlite is a miracle.
>
> > On Dec 30, 11:43 am, vvk  wrote:
>
> > > query = (-1)
> > > query = (db.somedb.id > 0) & query
>
> > > This querying worked with SQLITE. But it's giving following error with
> > > postgres:
>
> > > ProgrammingError: argument of AND must be type boolean, not type
> > > integer
> > > LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> > > -1);
>
> > > i) I think there is problem with type conversions, is there a way
> > > out ?
>
> > > ii) Is there a way to initialize a NULL query (like query = (-1) I did
> > > earlier ?)
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38082] Two Errors

2009-12-30 Thread Leandro - ProfessionalIT
Friends,
  I have two Problems in my blog App (running in GAE).
  1) In the code that generate the RSS by category:
 - It's run but only if I don't put the orderby declaration in
db.select() method but
 I need to sort my posts by ~created(DESC created) date to
generate my RSS feeds.

My RSS function:

def rss():
import datetime

response.headers['Content-Type']='application/rss+xml;charset=utf-8'
import gluon.contrib.rss2 as rss2
try:
cat_name = request.args[0]
if cat_name == 'all':
cat_name = ''
if cat_name != '' :
cat = 
db(db.categories.name==cat_name).select()[0]
# This code generate a Exception
#posts = db(
#   (db.posts.category == 
cat.id)
#   ).select(db.posts.ALL, 
orderby=~db.posts.created)

# This code run OK.
posts = db(
(db.posts.category == 
cat.id)
).select(db.posts.ALL)

else:
posts = db().select(db.posts.ALL, 
orderby=~db.posts.created)
except Exception, e:
raise e

    more code 


  2) Filter posts by category name with name in Portuguese:
 - I have a function that show-me the posts in determined
category,
 but if the category name is writted with especial characters/
Latin characters I receive a Exception.

My posts by category function:

# If request.args[0] is 'News' run OK
# If request.args[0] is 'Programação' I receive a Exception
def category():
try:
cat_name = request.args[0]
cat = db(db.categories.name==cat_name).select()[0]
recordsby=7
if request.vars.pagina:
page=int(request.vars.pagina)
else:
page=0
totalrecs = len(db((db.posts.category == cat.id)).select
(db.posts.ALL))
posts = db((db.posts.category == cat.id)).select
(db.posts.ALL,limitby=(page*recordsby,(page*recordsby)+recordsby))

backward=A('Anteriores',_href=URL(r=request,args=[cat_name],vars=dict
(pagina=page-1))) if page else ''

forward=A('Próximos',_href=URL(r=request,args=[cat_name],vars=dict
(pagina=page+1))) if totalrecs>((page*recordsby)+recordsby) else ''
response.rss_url = "/blog/rss/%s/" % cat_name
return dict(posts = posts,backward=backward,forward=forward)
except Exception, e:
raise e

How to resolve this two problems ?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38081] Re: Cron error

2009-12-30 Thread vvk
worked flawlessly :) .. thank you

On Dec 30, 11:21 pm, mdipierro  wrote:
> My bad. Try this:
>
> @auth.requires(not request.wsgi or auth.has_permission('least'))
>
> On Dec 30, 12:13 pm, vvk  wrote:
>
> > Sir,
> > Cron isnt working when I put that validator, error given is same as
> > mentioned earlier . Cron is working properly without any validator.
>
> > Here is my function. Kindly let me know if any problem is there.
>
> > @auth.requires(not request.env.remote_addr or auth.has_permission
> > ('least'))
> > def takebackup():
> > """
> > Max. No. of backups are four. When fourth one is saved, check is done
> > if there are already four, if there are four, oldest backup is deleted
> > """
> >         import os
> >         file_to_delete = ""
> >         backup_count = db(db.backup_entry.id > 0).count()
>
> >         if backup_count > 3:
> >                 least_entry = db.backup_entry.dateofentry.min()
> >                 query = db(db.backup_entry.id > 0).select()
> >                 least_entry = datetime.datetime.today()
> >                 for i in query:
> >                         if i.dateofentry < least_entry:
> >                                 least_entry = i.dateofentry
>
> >                 db(db.backup_entry.dateofentry == least_entry).delete
> > ()
> >                 file_to_delete = "backup" + "_" + str(least_entry) +
> > ".csv"
> >                 try:
> >                         os.remove ('/home/www-data/backups/lsi/' +
> > file_to_delete)
> >                 except:
> >                         do_nothing = 1
>
> >         current_time = str(datetime.datetime.today()).split(".")
> > [0]             # File name
> >         file_backup = "backup" + "_" + current_time + ".csv"
>
> >         db.export_to_csv_file(open('/home/www-data/backups/lsi/' +
> > file_backup,'wb'))
> >         db.backup_entry.insert(dateofentry = current_time)
> >         db.commit()
> >         return dict(form='')
>
> > On Dec 30, 11:36 am, mdipierro  wrote:
>
> > > You are referring to the auth decorator. Try this:
>
> > > @auth.requires(not request.env.remote_addr or auth.has_permission
> > > ('xyz'))
> > > def takebackup():
>
> > > When the request comes from cron there is no request.env.remote_addr
>
> > > On Dec 29, 9:29 pm, vvk  wrote:
>
> > > > Hi sir,
> > > > Cron job function in my application is working only when there is no
> > > > validator for that function.
>
> > > > My function:
> > > > @auth.requires_permision('xyz')
> > > > def takebackup():
>
> > > > Is there a way to put a validator for that function because if there
> > > > is no validator, any one can run backup function.
>
> > > > This is the error I'm getting when there is a validator like
> > > > @auth.requires_permission('xyz')
>
> > > > Traceback (most recent call last):
> > > >   File "web2py.py", line 20, in 
> > > >     gluon.widget.start(cron=True)
> > > >   File "/home/www-data/web2py/gluon/widget.py", line 743, in start
> > > >     import_models=options.import_models, startfile=options.run)
> > > >   File "/home/www-data/web2py/gluon/shell.py", line 163, in run
> > > >     exec ('print %s()' % f, _env)
> > > >   File "", line 1, in 
> > > >   File "/home/www-data/web2py/gluon/tools.py", line 1688, in f
> > > >     redirect(self.settings.login_url + '?_next='+urllib.quote(next))
> > > >   File "/home/www-data/web2py/gluon/http.py", line 104, in redirect
> > > >     Location=location)
> > > > gluon.http.HTTP
>
> > > > On Dec 29, 11:05 pm, vvk  wrote:
>
> > > > > Thanks sir, it's working now.
>
> > > > > On Dec 29, 10:57 pm, mdipierro  wrote:
>
> > > > > > 0-59/1 * * * * user *default/index
>
> > > > > > On Dec 29, 11:55 am, vvk  wrote:
>
> > > > > > > Hi,
> > > > > > > I'm getting an error for putting cron in default welcome 
> > > > > > > application
> > > > > > > which came with web2py 1.74.4 src code
>
> > > > > > > I edited crontab file in welcome application as:
> > > > > > > 0-59/1 * * * * *default/index
>
> > > > > > > Error:
>
> > > > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
> > > > > > > WARNING:root:Traceback (most recent call last):
> > > > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > > > 293, in crondance
> > > > > > >     task = parsecronline(cline)
> > > > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > > > 230, in parsecronline
> > > > > > >     task['cmd'] = params[6].strip()
> > > > > > > IndexError: list index out of range
>
> > > > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
>
> > > > > > > Any help would be greatly appreciated.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38080] Re: Problem with Postgresql DAL

2009-12-30 Thread vvk
worked flawlessly .. :) thank you

On Dec 30, 11:20 pm, vvk  wrote:
> How to initialize a NULL query
>
> My query should be ANDed with various tables depending on arguments I
> receive.
>
> Like:
>     if arg1 == "xyz":
>          query = (db.abc.id > 0)
>     if arg2 == "xyz":
>          query = (db.def.id > 0) & query
>
> In my "second if" condition, if "first if" condition is not executed,
> error occurs that query is not initialised. How to tackle this ?
>
> On Dec 30, 10:51 pm, mdipierro  wrote:
>
> > This:
>
> > query = (-1)
>
> > is not a valid query. The fact it works with sqlite is a miracle.
>
> > On Dec 30, 11:43 am, vvk  wrote:
>
> > > query = (-1)
> > > query = (db.somedb.id > 0) & query
>
> > > This querying worked with SQLITE. But it's giving following error with
> > > postgres:
>
> > > ProgrammingError: argument of AND must be type boolean, not type
> > > integer
> > > LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> > > -1);
>
> > > i) I think there is problem with type conversions, is there a way
> > > out ?
>
> > > ii) Is there a way to initialize a NULL query (like query = (-1) I did
> > > earlier ?)

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38079] Re: Cron error

2009-12-30 Thread mdipierro
My bad. Try this:

@auth.requires(not request.wsgi or auth.has_permission('least'))

On Dec 30, 12:13 pm, vvk  wrote:
> Sir,
> Cron isnt working when I put that validator, error given is same as
> mentioned earlier . Cron is working properly without any validator.
>
> Here is my function. Kindly let me know if any problem is there.
>
> @auth.requires(not request.env.remote_addr or auth.has_permission
> ('least'))
> def takebackup():
> """
> Max. No. of backups are four. When fourth one is saved, check is done
> if there are already four, if there are four, oldest backup is deleted
> """
>         import os
>         file_to_delete = ""
>         backup_count = db(db.backup_entry.id > 0).count()
>
>         if backup_count > 3:
>                 least_entry = db.backup_entry.dateofentry.min()
>                 query = db(db.backup_entry.id > 0).select()
>                 least_entry = datetime.datetime.today()
>                 for i in query:
>                         if i.dateofentry < least_entry:
>                                 least_entry = i.dateofentry
>
>                 db(db.backup_entry.dateofentry == least_entry).delete
> ()
>                 file_to_delete = "backup" + "_" + str(least_entry) +
> ".csv"
>                 try:
>                         os.remove ('/home/www-data/backups/lsi/' +
> file_to_delete)
>                 except:
>                         do_nothing = 1
>
>         current_time = str(datetime.datetime.today()).split(".")
> [0]             # File name
>         file_backup = "backup" + "_" + current_time + ".csv"
>
>         db.export_to_csv_file(open('/home/www-data/backups/lsi/' +
> file_backup,'wb'))
>         db.backup_entry.insert(dateofentry = current_time)
>         db.commit()
>         return dict(form='')
>
> On Dec 30, 11:36 am, mdipierro  wrote:
>
> > You are referring to the auth decorator. Try this:
>
> > @auth.requires(not request.env.remote_addr or auth.has_permission
> > ('xyz'))
> > def takebackup():
>
> > When the request comes from cron there is no request.env.remote_addr
>
> > On Dec 29, 9:29 pm, vvk  wrote:
>
> > > Hi sir,
> > > Cron job function in my application is working only when there is no
> > > validator for that function.
>
> > > My function:
> > > @auth.requires_permision('xyz')
> > > def takebackup():
>
> > > Is there a way to put a validator for that function because if there
> > > is no validator, any one can run backup function.
>
> > > This is the error I'm getting when there is a validator like
> > > @auth.requires_permission('xyz')
>
> > > Traceback (most recent call last):
> > >   File "web2py.py", line 20, in 
> > >     gluon.widget.start(cron=True)
> > >   File "/home/www-data/web2py/gluon/widget.py", line 743, in start
> > >     import_models=options.import_models, startfile=options.run)
> > >   File "/home/www-data/web2py/gluon/shell.py", line 163, in run
> > >     exec ('print %s()' % f, _env)
> > >   File "", line 1, in 
> > >   File "/home/www-data/web2py/gluon/tools.py", line 1688, in f
> > >     redirect(self.settings.login_url + '?_next='+urllib.quote(next))
> > >   File "/home/www-data/web2py/gluon/http.py", line 104, in redirect
> > >     Location=location)
> > > gluon.http.HTTP
>
> > > On Dec 29, 11:05 pm, vvk  wrote:
>
> > > > Thanks sir, it's working now.
>
> > > > On Dec 29, 10:57 pm, mdipierro  wrote:
>
> > > > > 0-59/1 * * * * user *default/index
>
> > > > > On Dec 29, 11:55 am, vvk  wrote:
>
> > > > > > Hi,
> > > > > > I'm getting an error for putting cron in default welcome application
> > > > > > which came with web2py 1.74.4 src code
>
> > > > > > I edited crontab file in welcome application as:
> > > > > > 0-59/1 * * * * *default/index
>
> > > > > > Error:
>
> > > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
> > > > > > WARNING:root:Traceback (most recent call last):
> > > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > > 293, in crondance
> > > > > >     task = parsecronline(cline)
> > > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > > 230, in parsecronline
> > > > > >     task['cmd'] = params[6].strip()
> > > > > > IndexError: list index out of range
>
> > > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
>
> > > > > > Any help would be greatly appreciated.
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38078] Re: Problem with Postgresql DAL

2009-12-30 Thread vvk
How to initialize a NULL query

My query should be ANDed with various tables depending on arguments I
receive.

Like:
if arg1 == "xyz":
 query = (db.abc.id > 0)
if arg2 == "xyz":
 query = (db.def.id > 0) & query

In my "second if" condition, if "first if" condition is not executed,
error occurs that query is not initialised. How to tackle this ?




On Dec 30, 10:51 pm, mdipierro  wrote:
> This:
>
> query = (-1)
>
> is not a valid query. The fact it works with sqlite is a miracle.
>
> On Dec 30, 11:43 am, vvk  wrote:
>
> > query = (-1)
> > query = (db.somedb.id > 0) & query
>
> > This querying worked with SQLITE. But it's giving following error with
> > postgres:
>
> > ProgrammingError: argument of AND must be type boolean, not type
> > integer
> > LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> > -1);
>
> > i) I think there is problem with type conversions, is there a way
> > out ?
>
> > ii) Is there a way to initialize a NULL query (like query = (-1) I did
> > earlier ?)

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38077] Re: Cron error

2009-12-30 Thread vvk
Sir,
Cron isnt working when I put that validator, error given is same as
mentioned earlier . Cron is working properly without any validator.

Here is my function. Kindly let me know if any problem is there.


@auth.requires(not request.env.remote_addr or auth.has_permission
('least'))
def takebackup():
"""
Max. No. of backups are four. When fourth one is saved, check is done
if there are already four, if there are four, oldest backup is deleted
"""
import os
file_to_delete = ""
backup_count = db(db.backup_entry.id > 0).count()

if backup_count > 3:
least_entry = db.backup_entry.dateofentry.min()
query = db(db.backup_entry.id > 0).select()
least_entry = datetime.datetime.today()
for i in query:
if i.dateofentry < least_entry:
least_entry = i.dateofentry

db(db.backup_entry.dateofentry == least_entry).delete
()
file_to_delete = "backup" + "_" + str(least_entry) +
".csv"
try:
os.remove ('/home/www-data/backups/lsi/' +
file_to_delete)
except:
do_nothing = 1

current_time = str(datetime.datetime.today()).split(".")
[0] # File name
file_backup = "backup" + "_" + current_time + ".csv"

db.export_to_csv_file(open('/home/www-data/backups/lsi/' +
file_backup,'wb'))
db.backup_entry.insert(dateofentry = current_time)
db.commit()
return dict(form='')



On Dec 30, 11:36 am, mdipierro  wrote:
> You are referring to the auth decorator. Try this:
>
> @auth.requires(not request.env.remote_addr or auth.has_permission
> ('xyz'))
> def takebackup():
>
> When the request comes from cron there is no request.env.remote_addr
>
> On Dec 29, 9:29 pm, vvk  wrote:
>
> > Hi sir,
> > Cron job function in my application is working only when there is no
> > validator for that function.
>
> > My function:
> > @auth.requires_permision('xyz')
> > def takebackup():
>
> > Is there a way to put a validator for that function because if there
> > is no validator, any one can run backup function.
>
> > This is the error I'm getting when there is a validator like
> > @auth.requires_permission('xyz')
>
> > Traceback (most recent call last):
> >   File "web2py.py", line 20, in 
> >     gluon.widget.start(cron=True)
> >   File "/home/www-data/web2py/gluon/widget.py", line 743, in start
> >     import_models=options.import_models, startfile=options.run)
> >   File "/home/www-data/web2py/gluon/shell.py", line 163, in run
> >     exec ('print %s()' % f, _env)
> >   File "", line 1, in 
> >   File "/home/www-data/web2py/gluon/tools.py", line 1688, in f
> >     redirect(self.settings.login_url + '?_next='+urllib.quote(next))
> >   File "/home/www-data/web2py/gluon/http.py", line 104, in redirect
> >     Location=location)
> > gluon.http.HTTP
>
> > On Dec 29, 11:05 pm, vvk  wrote:
>
> > > Thanks sir, it's working now.
>
> > > On Dec 29, 10:57 pm, mdipierro  wrote:
>
> > > > 0-59/1 * * * * user *default/index
>
> > > > On Dec 29, 11:55 am, vvk  wrote:
>
> > > > > Hi,
> > > > > I'm getting an error for putting cron in default welcome application
> > > > > which came with web2py 1.74.4 src code
>
> > > > > I edited crontab file in welcome application as:
> > > > > 0-59/1 * * * * *default/index
>
> > > > > Error:
>
> > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
> > > > > WARNING:root:Traceback (most recent call last):
> > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > 293, in crondance
> > > > >     task = parsecronline(cline)
> > > > >   File "/Users/varun/Downloads/web2py/gluon/contrib/cron.py", line
> > > > > 230, in parsecronline
> > > > >     task['cmd'] = params[6].strip()
> > > > > IndexError: list index out of range
>
> > > > > WARNING:root:WEB2PY CRON: exception: list index out of range
>
> > > > > Any help would be greatly appreciated.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38076] In case you missed this pure python module to read and write docx files.

2009-12-30 Thread mdipierro
http://github.com/mikemaccana/python-docx

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38075] roadmap?!

2009-12-30 Thread mdipierro
Alvaro said this over and over. We need a roadmap.

For me the most important things are:

1) getting the new DAL done (and include support for more NoDB and
Sybase)

2) Create a set of standard and customizable plugins for:
  a) comments (*)
  b) tagging (*)
  c) voting/rating
  d) wiki/versioning
  e) attachements of documents
  f) google checkout (*)
  e) quizzes and surveys (we can take it out from kpax)
  g) autocomplete
  h) embedding media files (photo gallery, video player, etc)
  i) customization of layout (*)
(*) we have some prototyes but not production quality yet.

I could use help with these and some of you have demonstrated better
skills than mine on this.

3) merge T4 and kpax to use plugins.

4) Create a portable StringListProperty model type that works without
GAE.

5) Create a widget to display a StringListProperty field.

Massimo

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38074] Re: Problem with Postgresql DAL

2009-12-30 Thread mdipierro
This:

query = (-1)

is not a valid query. The fact it works with sqlite is a miracle.

On Dec 30, 11:43 am, vvk  wrote:
> query = (-1)
> query = (db.somedb.id > 0) & query
>
> This querying worked with SQLITE. But it's giving following error with
> postgres:
>
> ProgrammingError: argument of AND must be type boolean, not type
> integer
> LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
> -1);
>
> i) I think there is problem with type conversions, is there a way
> out ?
>
> ii) Is there a way to initialize a NULL query (like query = (-1) I did
> earlier ?)

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38073] Problem with Postgresql DAL

2009-12-30 Thread vvk
query = (-1)
query = (db.somedb.id > 0) & query

This querying worked with SQLITE. But it's giving following error with
postgres:

ProgrammingError: argument of AND must be type boolean, not type
integer
LINE 1: ...rchase WHERE (purchase.timeofpurchase<='2009-12-29' AND
-1);

i) I think there is problem with type conversions, is there a way
out ?

ii) Is there a way to initialize a NULL query (like query = (-1) I did
earlier ?)

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38072] Re: web2py and python 2.4

2009-12-30 Thread mdipierro
In trunk, thank you

On Dec 30, 4:39 am, "ont.rif"  wrote:
> I have found a few more problems. Below content of a patch which can
> fix them.
> Patched code sucessfully runs on CentOS 5.4  (web2py 1.74.4).
> I drop out fixes for sql.py
>
> diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/main.py ./2.4/
> main.py
> --- ./2.5/main.py       2009-12-16 12:42:47.0 +0700
> +++ ./2.4/main.py       2009-12-30 16:19:47.0 +0700
> @@ -29,7 +29,7 @@
>  import random
>  #import sneaky
>  import rewrite
> -import functools
> +#import functools
>  import string
>  from restricted import RestrictedError
>  from http import HTTP, redirect
> @@ -212,7 +212,8 @@
>      """
>      response.status = str(status).split(' ',1)[0]
>      response.headers = dict(headers)
> -    return functools.partial(response.write, escape=False)
> +    return lambda *args, **kargs: response.write( escape=False,
> *args, **kargs )
> +    #return functools.partial(response.write, escape=False)
>
>  def middleware_aux(request, response, *middleware_apps):
> Только в ./2.5: python24.patch
> Только в ./2.5: .sql.py.swp
> diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/tools.py ./2.4/
> tools.py
> --- ./2.5/tools.py      2009-12-23 02:48:17.0 +0700
> +++ ./2.4/tools.py      2009-12-30 16:46:48.0 +0700
> @@ -17,7 +17,7 @@
>  import base64
>  import cPickle
>  import datetime
> -import email
> +from email import *
>  import sys
>  import os
>  import re
> @@ -53,7 +53,7 @@
>      Works with SMTP and Google App Engine.
>      """
>
> -    class Attachment(email.MIMEBase.MIMEBase):
> +    class Attachment(MIMEBase.MIMEBase):
>          """
>          Email attachment
>
> @@ -121,12 +121,12 @@
>              filename = filename.encode(encoding)
>              if content_type == None:
>                  content_type = contenttype(filename)
> -            email.MIMEBase.MIMEBase.__init__(self, *content_type.split
> ('/', 1))
> +            MIMEBase.MIMEBase.__init__(self, *content_type.split('/',
> 1))
>              self.set_payload(payload)
>              self['Content-Disposition'] = 'attachment; filename="%s"'
> % filename
>              if content_id != None:
>                  self['Content-Id'] = '<%s>' % content_id.encode
> (encoding)
> -            email.Encoders.encode_base64(self)
> +            Encoders.encode_base64(self)
>
>      def __init__(self, server=None, sender=None, login=None,
> tls=True):
>          """
> @@ -251,7 +251,7 @@
>              to = list(to)
>          if len(to) == 0:
>              raise Exception('Target receiver address not specified')
> -        payload = email.MIMEMultipart.MIMEMultipart('related')
> +        payload = MIMEMultipart.MIMEMultipart('related')
>          payload['To'] = ', '.join(to).decode(encoding).encode
> ('utf-8')
>          if reply_to != None:
>              payload['Reply-To'] = reply_to.decode(encoding).encode
> ('utf-8')
> @@ -274,19 +274,19 @@
>              text = message
>              html = None
>          if text != None or html != None:
> -            attachment = email.MIMEMultipart.MIMEMultipart
> ('alternative')
> +            attachment = MIMEMultipart.MIMEMultipart('alternative')
>              if text != None:
>                  if isinstance(text, str):
>                      text = text.decode(encoding).encode('utf-8')
>                  else:
>                      text = text.read().decode(encoding).encode
> ('utf-8')
> -                attachment.attach(email.MIMEText.MIMEText(text))
> +                attachment.attach(MIMEText.MIMEText(text))
>              if html != None:
>                  if isinstance(html, str):
>                      html = html.decode(encoding).encode('utf-8')
>                  else:
>                      html = html.read().decode(encoding).encode
> ('utf-8')
> -                attachment.attach(email.MIMEText.MIMEText(html,
> 'html'))
> +                attachment.attach(MIMEText.MIMEText(html, 'html'))
>              payload.attach(attachment)
>          if attachments == None:
>              pass
>
> On 30 дек, 04:26, mdipierro  wrote:
>
> > Ouch! You are right. That code slipped in. I have just removed them in
> > trunk (hg only, I am having problem posting on launchpad) and will
> > repost 1.74.5 later this week.
>
> > Massimo
>
> > On Dec 29, 2:59 pm, Richard  wrote:
>
> > > I think there are a few examples in sql.py, such as lines 2928 and
> > > 2939
>
> > > On Dec 30, 1:53 am, mdipierro  wrote:
>
> > > > web2py libraries does not use (a if Condition else b) but example apps
> > > > and plugins may.
>
> > > > It works with2.4but you need some extra modules. There is an
> > > > AlterEgo entry about this.
>
> > > > On Dec 29, 7:48 am, Richard  wrote:
>
> > > > > did you manage to get web2py running with2.4? I noticed web2py uses
> > > > > (a if Condition else b), which was syntax introduced in 2.5.
> > > > > Richard
>
> > > > > On Nov 22, 11:12 am, pepe_eloy  wrote:
>
> > > > > > Returning to the theme about

Re: [web2py:38071] Re: How the 'auth.settings.allow_basic_login = True' works like?

2009-12-30 Thread Massimo Di Pierro
It depends. Unless you have custom auth_user table with a username  
field, your username is the email and that is what you should use in  
basic auth.

On Dec 30, 2009, at 10:12 AM, Alex Fanjul wrote:

> Massimo I think the username is not an email, is just the standard way
> of accessing url with basic auth, isn't it?
> http://  username : password @ domain : port / uri
>
> alex
>
> El 30/12/2009 15:25, mdipierro escribió:
>> That probably will not work since it is not what was designed for.
>> I am not sure why it did not work thou.
>> If the username is the email, did you escape it?
>>
>> On Dec 30, 1:16 am, David Marko  wrote:
>>
>>> I simply tried to call the method with URLcontaining the username/
>>> password. e.g. tttp://username:p...@localhost:8080/  . Its just
>>> internal call so its fine that username/pwd is in URL. I simply  
>>> tried
>>> this in browser, but login form apeared instead.
>>>
>>> David
>>>
>>> On Dec 29, 10:25 pm, mdipierro  wrote:
>>>
>>>
 The allow basic login allows you to call functions that
 @auth.requires_login() by passing the credential using basic auth  
 for
 example call the url using wget and curl.

>>>
 How are you using it?

>>>
 On Dec 29, 2:59 pm, David Marko  wrote:

>>>
> How the settings 'auth.settings.allow_basic_login = True' is  
> supposed
> to work? I tried to login to protected  
> method('@auth.requires_login
> ()') via basic auth, but was not succesfull. Is there some  
> additional
> setting for protected methods or '@auth.requires_login()'' is  
> simply
> used for both auth ? Can someone explain please?
>
>>>
> David
>
>>>
>>>
>> --
>>
>> You received this message because you are subscribed to the Google  
>> Groups "web2py-users" group.
>> To post to this group, send email to web...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> web2py+unsubscr...@googlegroups.com 
>> .
>> For more options, visit this group at 
>> http://groups.google.com/group/web2py?hl=en 
>> .
>>
>>
>>
>>
>
> -- 
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.com
> www.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38070] Re: Standalone Web2py that accepts all request on a given port.

2009-12-30 Thread mdipierro
Using trunk, please try the -Q option. No more splash screen.

On Dec 29, 12:23 pm, Delaney  wrote:
> My testing show that having a "taskbar=True" in the options.py results
> in thesplashscreen and the taskbar icon
> However using 'web2py_no_console.exe -t -L options.py ' results in not
> having thesplashscreen but also not the taskbar icon as well.  Task
> Manager shows the exe actually running in the background.
>
> With my limited understanding of the web2py source it looks like its
> only being called from web2py/gluon/widget.py from 273-302 and I'm not
> seeing anything  the would disable it because of using the command
> line versus the options.py file.  Not sure where to go with this.
>
> On a seperate note are there any instructions/guides on how to use
> py2exe with the web2py source?  Doesn't seem like 'python setup_exe.py
> py2exe' works out of the box.
>
> On Dec 28, 3:25 pm, mdipierro  wrote:
>
> > It is hard to test this for me since I do not have windows. There
> > should not be asplashscreen when running with -t if options.py is
> > present. I would take a patch to fix this.
>
> > On Dec 28, 2:21 pm, Delaney  wrote:
>
> > > That doesn't seem to be true if you combine with -t option.  For
> > > web2py.exe as well.
>
> > > On Dec 28, 11:32 am, mdipierro  wrote:
>
> > > > Not sure if this is what you are asking but if you run web2py.exe with
> > > > -a 'password' there will be nosplashscreen. Not sure about
> > > > web2py_no_console.exe since i do not use windows and I never tried it
> > > > myself.
>
> > > > Massimo
>
> > > > On Dec 28, 1:04 pm, Delaney  wrote:
>
> > > > > Yep, with a few more things (profiler_filename, ssl, etc) the options
> > > > > file works!
>
> > > > > On last thing.  Since this is a backend that a non-techy will run (as
> > > > > the 'server' at a expo kiosk)  is there anyway to either disable or
> > > > > modify thesplashscreen for the web2py_no_console.exe -t at
> > > > > startup.  I have no problem having a 'Powered by Web2py on thesplash
> > > > > screen but having no control to show its 'my app' USING web2py makes
> > > > > it confusing and not as finished a project.  Also would be nice to be
> > > > > able to change the icon displayed as well, which I know is hardcoded
> > > > > at the moment.
>
> > > > > Any thoughts Massimo?
>
> > > > > On Dec 28, 10:40 am, mdipierro  wrote:
>
> > > > > > you need these in options.py
>
> > > > > > extcron = None
> > > > > > nocron = None
>
> > > > > > On Dec 28, 12:20 pm, Delaney  wrote:
>
> > > > > > > Thanks... This works as a param on the command line ''' start
> > > > > > > web2py_no_console.exe -t -a "" -p 80 -i 0.0.0.0 '''
>
> > > > > > > But if create a options.py with
>
> > > > > > > import socket,os
> > > > > > > ip = '0.0.0.0'
> > > > > > > port = 80
> > > > > > > taskbar = True
> > > > > > > password = ''
> > > > > > > folder = os.getcwd()
> > > > > > > server_name = socket.gethostname()
>
> > > > > > > I get...
>
> > > > > > > >web2py.exe -L options.py
>
> > > > > > > default applications appear to be installed already
> > > > > > > web2py Enterprise Web Framework
> > > > > > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > > > > > Version 1.72.3 (2009-11-10 09:17:13)
> > > > > > > Database drivers available: SQLite3, MySQL
> > > > > > > Starting cron...
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "web2py.py", line 5, in 
> > > > > > >   File "gluon/widget.py", line 779, in start
> > > > > > > AttributeError: 'module' object has no attribute 'extcron'
>
> > > > > > > Note this happens with a options.py with even just 'port=80' in 
> > > > > > > it.
> > > > > > > Is there something else I'm missing?
>
> > > > > > > On Dec 28, 9:57 am, mdipierro  wrote:
>
> > > > > > > > If you use the built-in web server, when you start it, serve 
> > > > > > > > from
> > > > > > > > 0.0.0.0
>
> > > > > > > > On Dec 28, 11:39 am, Delaney  wrote:
>
> > > > > > > > > I'm using web2py for an intranet but notice that in the 
> > > > > > > > > default config
> > > > > > > > > web2py does not handle all requests to the port you serve 
> > > > > > > > > from.
> > > > > > > > > Basically I want to accept connections from
> > > > > > > > > 'localhost','127.0.0.1','whatevermyhostnameis','etc' all on 
> > > > > > > > > say port
> > > > > > > > > 80 of the server.  I know how to set this up but can't seem 
> > > > > > > > > to find
> > > > > > > > > the right page explaining it in the manual.  I see on page 
> > > > > > > > > 111 it
> > > > > > > > > talks about the 'options_std.py' file but doesn't explain if 
> > > > > > > > > for
> > > > > > > > > example you can set the ip to for example  
> > > > > > > > > ['127.0.0.1','192.168.0.1']
> > > > > > > > > or hostname to [socket.gethostname(),'localhost']
>
> > > > > > > > > Any help would be appreciated... Thanks!
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web..

[web2py:38069] Error reading from pickle

2009-12-30 Thread robsan
Hi all,

I'm using http://www.crummy.com/software/ScrapeNFeed/ to scrape a
webpage and produce a RSS feed. ScrapeNFeed uses a pickle file to
store information/history about this feed. The code below works fine
on the 1st run when the pickle file does not exist, but after it gets
created I get the following error:

"File "/home/robsan/run/lib/python2.6/pickle.py", line 1126, in
find_class
klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'SSDFeed'"


Code on controllers/default.py:

def feed():
class SSDFeed(ScrapeNFeed.ScrapedFeed):

def HTML2RSS(self, headers, body):
[...]

SSDFeed.load()


Any ideas, please?

Roberto

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38068] Re: Postgresql-types limited by web2py :(

2009-12-30 Thread mdipierro
On a second thought. My fix in trunk is not the proper way so I am
revering it. The problem is that your custom type needs to have an
encoder and perhaps a decoder. Try this:

cidr = SQLCustomType ( type='string', native='cidr', encoder=lambda x:
repr(str(x)) )

On Dec 30, 8:33 am, mdipierro  wrote:
> Please try the version in trunk.
>
> Massimo
>
> On Dec 30, 1:20 am, KMax  wrote:
>
> > This code start to work
> > ===
> > from gluon.sql import SQLCustomType
>
> > db = DAL('postgres://web2py:gfhj...@db.sibnet.su/test1',
> > pool_size=10)
> > inet = SQLCustomType ( type='string',native='inet')
>
> > db.define_table('firewall',
> >     SQLField('network',type=inet))
> > ===
> > Look like
> > ==from gluon.dal import SQLCustomType
> > was not good idea.
> > BUT
> > Inserting or updating using web2py db admin
> > Shows following:
> > ---
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> >     exec ccode in environment
> >   File "/home/web2py/applications/test/controllers/appadmin.py", line
> > 304, in 
> >   File "gluon/globals.py", line 96, in 
> >     self._caller = lambda f: f()
> >   File "/home/web2py/applications/test/controllers/appadmin.py", line
> > 286, in update
> >     if form.accepts(request.vars, session):
> >   File "gluon/sqlhtml.py", line 896, in accepts
> >     self.table._db(self.table.id == self.record.id).update(**fields)
> >   File "gluon/sql.py", line 3151, in update
> >     self._db._execute(query)
> >   File "gluon/sql.py", line 952, in 
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > ProgrammingError: syntax error at or near ".3"
> > LINE 1: UPDATE firewall SET network=1.2.3.5 WHERE firewall.id=1;
> > ===
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> >     exec ccode in environment
> >   File "/home/web2py/applications/test/controllers/appadmin.py", line
> > 304, in 
> >   File "gluon/globals.py", line 96, in 
> >     self._caller = lambda f: f()
> >   File "/home/web2py/applications/test/controllers/appadmin.py", line
> > 124, in insert
> >     if form.accepts(request.vars, session):
> >   File "gluon/sqlhtml.py", line 898, in accepts
> >     self.vars.id = self.table.insert(**fields)
> >   File "gluon/sql.py", line 1844, in insert
> >     self._db._execute(query)
> >   File "gluon/sql.py", line 952, in 
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > ProgrammingError: syntax error at or near ".1"
> > LINE 1: INSERT INTO firewall(network) VALUES (1.1.1.2);
>
> > Thank you for your helping
> > On Dec 30, 12:31 pm, mdipierro  wrote:
>
> > > I need your help debugging this... the relevant code in sql.py is
>
> > >             if isinstance(field.type,SQLCustomType):
> > >                 ftype = field.type.native or field.type.type
> > >             elif ...
> > >             elif not field.type in self._db._translator:
> > >                 raise SyntaxError, 'Field: unknown field type: %s for %s' 
> > > % \
> > >                     (field.type, field.name)
>
> > > You get error on the last line but given the code you show me, it
> > > should never get there. The first if should be true because field.type
> > > should be cidr which is SQLCustomType.
>
> > > Try add some print statements and see what happens.
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38067] Re: How the 'auth.settings.allow_basic_login = True' works like?

2009-12-30 Thread Alex Fanjul
Massimo I think the username is not an email, is just the standard way 
of accessing url with basic auth, isn't it?
http://  username : password @ domain : port / uri

alex

El 30/12/2009 15:25, mdipierro escribió:
> That probably will not work since it is not what was designed for.
> I am not sure why it did not work thou.
> If the username is the email, did you escape it?
>
> On Dec 30, 1:16 am, David Marko  wrote:
>
>> I simply tried to call the method with URLcontaining the username/
>> password. e.g. tttp://username:p...@localhost:8080/  . Its just
>> internal call so its fine that username/pwd is in URL. I simply tried
>> this in browser, but login form apeared instead.
>>
>> David
>>
>> On Dec 29, 10:25 pm, mdipierro  wrote:
>>
>>  
>>> The allow basic login allows you to call functions that
>>> @auth.requires_login() by passing the credential using basic auth for
>>> example call the url using wget and curl.
>>>
>>  
>>> How are you using it?
>>>
>>  
>>> On Dec 29, 2:59 pm, David Marko  wrote:
>>>
>>  
 How the settings 'auth.settings.allow_basic_login = True' is supposed
 to work? I tried to login to protected method('@auth.requires_login
 ()') via basic auth, but was not succesfull. Is there some additional
 setting for protected methods or '@auth.requires_login()'' is simply
 used for both auth ? Can someone explain please?
  
>>  
 David
  
>>
>>  
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38066] Re: rendering a Select as a Label

2009-12-30 Thread mdipierro
Are you talking about forms you made or forms in appadmin? forms in
appadmin ignore writable and readable by design. Your own forms should
not ignore them.

On Dec 30, 9:35 am, Miguel Lopes  wrote:
> On Wed, Dec 30, 2009 at 3:17 PM, mdipierro  wrote:
> > Please try 1.74.4 before I look into this more.
>
> I get the same problem with 1.74.4.
> I've just reproduced this with a new application using appdamin I also
> get the select tag.
> I would say this is a bug.
>
> The reproduction code is:
> db.define_table('account',
>     Field('name')
> )
>
> db.define_table('oppty_main',
>     Field('name'),
>     Field('origin_account_id', db.account, readable=False, writable=False),
> )
>
> db.oppty_main.origin_account_id.requires=IS_IN_DB(db, 'account.id', 
> '%(name)s')
>
> Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38065] Re: rendering a Select as a Label

2009-12-30 Thread Miguel Lopes
On Wed, Dec 30, 2009 at 3:17 PM, mdipierro  wrote:
> Please try 1.74.4 before I look into this more.

I get the same problem with 1.74.4.
I've just reproduced this with a new application using appdamin I also
get the select tag.
I would say this is a bug.

The reproduction code is:
db.define_table('account',
Field('name')
)

db.define_table('oppty_main',
Field('name'),
Field('origin_account_id', db.account, readable=False, writable=False),
)

db.oppty_main.origin_account_id.requires=IS_IN_DB(db, 'account.id', '%(name)s')

Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38064] Re: rendering a Select as a Label

2009-12-30 Thread mdipierro
Please try 1.74.4 before I look into this more.

On Dec 30, 9:03 am, Miguel Lopes  wrote:
> On Wed, Dec 30, 2009 at 2:57 PM, Miguel Lopes  wrote:
> > On Wed, Dec 30, 2009 at 2:54 PM, mdipierro  wrote:
> >> before the form=... try
>
> >> db.oppty_main.origin_account_id.writable=False
>
> >> you may also want to add:
>
> >> db.oppty_main.origin_account_id.readable=False
>
> > Txs for the tip Massimo!
>
> > I tried, using readable and writable attributes in the Field
> > definition, but these didn't propagate to the form! I wonder if this
> > is a quirk or not?
>
> > Miguel
>
> Actually it is not working either way.
> I'm using web2py 1.72.3 and with MacPython 2.5.4
> Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38063] Re: rendering a Select as a Label

2009-12-30 Thread Miguel Lopes
On Wed, Dec 30, 2009 at 2:57 PM, Miguel Lopes  wrote:
> On Wed, Dec 30, 2009 at 2:54 PM, mdipierro  wrote:
>> before the form=... try
>>
>> db.oppty_main.origin_account_id.writable=False
>>
>> you may also want to add:
>>
>> db.oppty_main.origin_account_id.readable=False
>>
>
> Txs for the tip Massimo!
>
> I tried, using readable and writable attributes in the Field
> definition, but these didn't propagate to the form! I wonder if this
> is a quirk or not?
>
> Miguel
>

Actually it is not working either way.
I'm using web2py 1.72.3 and with MacPython 2.5.4
Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38062] Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: unexpected code byte

2009-12-30 Thread mdipierro
I failed to reproduce this problem. Can anybody reproduce it?

On Dec 28, 5:33 pm, Tito Garrido  wrote:
> Via a webform... using SQLFORM
>
>
>
> On Sat, Dec 26, 2009 at 12:39 PM, mdipierro  wrote:
> > inserting via web forms or via db.table.insert(...)?
>
> > On Dec 26, 7:54 am, Tito Garrido  wrote:
> > > When I'm inserting strings using ç ã õ é á on GAE
>
> > > you can create a DB like:
> > > db.define_table('content',
> > >     Field('title','string'),
> > >     Field('subtitle','string'),
> > >     Field('data','text'),
> > >     )
>
> > > on the "data" column you will be able to add ã ç á... but on title or
> > > subtile will throw an Unicode error.
>
> > > Regards,
>
> > > Tito
>
> > > On Fri, Dec 25, 2009 at 11:19 PM, mdipierro 
> > wrote:
> > > > Can you describe the problem? Is this when inserting or when
> > > > extracting?
>
> > > > Massimo
>
> > > > On Dec 25, 4:21 pm, Tito Garrido  wrote:
> > > > > I'm getting this error for "string" fields on GAE... is that related?
> > For
> > > > > uploads and texts fields seems to be working...
>
> > > > > Regards,
>
> > > > > Tito
>
> > > > > On Wed, Dec 23, 2009 at 4:38 AM, v  wrote:
> > > > > > Great!  both solutions work fine now.  Have tested with a few
> > binary
> > > > > > file uploads.  Using your changes in the trunk to sql.py.
>
> > > > > > Thanks,
> > > > > > V
>
> > > > > > On Dec 23, 1:44 am, mdipierro  wrote:
> > > > > > > I may have fixed it in trunk. Could you please try it?
>
> > > > > > > On Dec 22, 2:26 pm, v  wrote:
>
> > > > > > > > Hi Massimo,
>
> > > > > > > > Thanks for your prompt response.
>
> > > > > > > > I tried uploading multiple binary files (image, pdf, etc.) and
> > it's
> > > > > > > > consistently the case.  I'm using latest web2py (downloaded few
> > > > hours
> > > > > > > > back): 1.74.3.  File name are pure ascii, so I don't see any
> > issues
> > > > > > > > there.  File sizes have been from 32KB to about 300KB.  Here's
> > the
> > > > > > > > trace from GAE logs.  I've masked my app-id (hope you won't
> > mind).
>
> > > > > > > > 
> > > > > > > > 122.172.62.200 - - [22/Dec/2009:11:05:41 -0800] "GET
> > > > /mywiki/default/
> > > > > > > > documents/2007 HTTP/1.1" 500 397 - "Mozilla/5.0 (Windows; U;
> > > > Windows
> > > > > > > > NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/
> > > > 4.0.249.30
> > > > > > > > Safari/532.5,gzip(gfe)" "XXX.appspot.com"
> > > > > > > > E 12-22 11:05AM 41.509
> > > > > > > > In FILE:
> > > > /base/data/home/apps/XXX/1.338633428120223078/applications/
> > > > > > > > mywiki/controllers/default.py
>
> > > > > > > > Traceback (most recent call last):
> > > > > > > >   File "/base/data/home/apps/XXX/1.338633428120223078/gluon/
> > > > > > > > restricted.py", line 173, in restricted
> > > > > > > >     exec ccode in environment
> > > > > > > >   File
> > "/base/data/home/apps/XXX/1.338633428120223078/applications/
> > > > > > > > mywiki/controllers/default.py:documents", line 112, in 
> > > > > > > >   File "/base/data/home/apps/XXX/1.338633428120223078/gluon/
> > > > > > > > globals.py", line 96, in 
> > > > > > > >     self._caller = lambda f: f()
> > > > > > > >   File
> > "/base/data/home/apps/XXX/1.338633428120223078/applications/
> > > > > > > > mywiki/controllers/default.py:documents", line 63, in documents
> > > > > > > >   File
> > > > "/base/data/home/apps/XXX/1.338633428120223078/gluon/contrib/
> > > > > > > > gql.py", line 666, in select
> > > > > > > >     return self.parse(self._db, rows, colnames, False)
> > > > > > > >   File
> > > > "/base/data/home/apps/XXX/1.338633428120223078/gluon/sql.py",
> > > > > > > > line 2998, in parse
> > > > > > > >     value = value.decode(db._db_codec)
> > > > > > > >   File "/base/python_dist/lib/python2.5/encodings/utf_8.py",
> > line
> > > > 16,
> > > > > > > > in decode
> > > > > > > >     return codecs.utf_8_decode(input, errors, True)
> > > > > > > > UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in
> > position
> > > > 0:
> > > > > > > > unexpected code byte
> > > > > > > > 
>
> > > > > > > > Hope I'm not doing something silly.  Perhaps if you get a
> > chance to
> > > > > > > > quickly test your mywiki example yourself on GAE, you should be
> > > > able
> > > > > > > > to reproduce it.
>
> > > > > > > > Thanks once again.
>
> > > > > > > > Best Regards,
> > > > > > > > V
>
> > > > > > > > On Dec 23, 1:09 am, mdipierro  wrote:
>
> > > > > > > > > Thank you v.
>
> > > > > > > > > Are you sure the problem is the file content and not the file
> > > > name or
> > > > > > > > > the file size?
> > > > > > > > > Which verison of web2py do you have?
> > > > > > > > > I any case, can you post the complete traceback?
>
> > > > > > > > > Massimo
>
> > > > > > > > > On Dec 22, 2:01 pm, v  wrote:
>
> > > > > > > > > > Hi Massimo,
>
> > > > > > > > > > First of all, thanks for creating web2py.. AMAZING work!!
> > > > Highly
> > > > > > > > > > intuitive and almost flat learning curve, compared with RoR
>

Re: [web2py:38061] Re: rendering a Select as a Label

2009-12-30 Thread Miguel Lopes
On Wed, Dec 30, 2009 at 2:54 PM, mdipierro  wrote:
> before the form=... try
>
> db.oppty_main.origin_account_id.writable=False
>
> you may also want to add:
>
> db.oppty_main.origin_account_id.readable=False
>

Txs for the tip Massimo!

I tried, using readable and writable attributes in the Field
definition, but these didn't propagate to the form! I wonder if this
is a quirk or not?

Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38060] Re: rendering a Select as a Label

2009-12-30 Thread mdipierro
before the form=... try

db.oppty_main.origin_account_id.writable=False

you may also want to add:

db.oppty_main.origin_account_id.readable=False

On Dec 30, 8:39 am, Miguel Lopes  wrote:
> I have a field with the following requirements:
>
> Field('origin_account_id', db.account),
> db.oppty_main.origin_account_id.requires=IS_IN_DB(db, 'account.id', 
> '%(name)s')
>
> In the controller:
> form=SQLFORM(db.oppty_main, record=oppty_main, deletable=True,
>                  fields=['name','origin_account_id','status'])
>
> And it's rendered with:
> {{=form}}
>
> My goal is to render the field as a Label or Disable the Select (so
> that the user cannot change the selection).
> In this particular case I might get away with coding if the value is
> in db, but I rather keep the requirement where it should be. Also, I'm
> pretty sure there's a way to accomplish this in web2py, so I would
> hate not doing it right!!! :-)
>
> Txs,
> Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38059] rendering a Select as a Label

2009-12-30 Thread Miguel Lopes
I have a field with the following requirements:

Field('origin_account_id', db.account),
db.oppty_main.origin_account_id.requires=IS_IN_DB(db, 'account.id', '%(name)s')

In the controller:
form=SQLFORM(db.oppty_main, record=oppty_main, deletable=True,
 fields=['name','origin_account_id','status'])

And it's rendered with:
{{=form}}

My goal is to render the field as a Label or Disable the Select (so
that the user cannot change the selection).
In this particular case I might get away with coding if the value is
in db, but I rather keep the requirement where it should be. Also, I'm
pretty sure there's a way to accomplish this in web2py, so I would
hate not doing it right!!! :-)

Txs,
Miguel

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38058] Re: web2py and python 2.4

2009-12-30 Thread mdipierro
Can you please email me the patch? Why change the the import email?

Massimo

On Dec 30, 4:39 am, "ont.rif"  wrote:
> I have found a few more problems. Below content of a patch which can
> fix them.
> Patched code sucessfully runs on CentOS 5.4  (web2py 1.74.4).
> I drop out fixes for sql.py
>
> diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/main.py ./2.4/
> main.py
> --- ./2.5/main.py       2009-12-16 12:42:47.0 +0700
> +++ ./2.4/main.py       2009-12-30 16:19:47.0 +0700
> @@ -29,7 +29,7 @@
>  import random
>  #import sneaky
>  import rewrite
> -import functools
> +#import functools
>  import string
>  from restricted import RestrictedError
>  from http import HTTP, redirect
> @@ -212,7 +212,8 @@
>      """
>      response.status = str(status).split(' ',1)[0]
>      response.headers = dict(headers)
> -    return functools.partial(response.write, escape=False)
> +    return lambda *args, **kargs: response.write( escape=False,
> *args, **kargs )
> +    #return functools.partial(response.write, escape=False)
>
>  def middleware_aux(request, response, *middleware_apps):
> Только в ./2.5: python24.patch
> Только в ./2.5: .sql.py.swp
> diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/tools.py ./2.4/
> tools.py
> --- ./2.5/tools.py      2009-12-23 02:48:17.0 +0700
> +++ ./2.4/tools.py      2009-12-30 16:46:48.0 +0700
> @@ -17,7 +17,7 @@
>  import base64
>  import cPickle
>  import datetime
> -import email
> +from email import *
>  import sys
>  import os
>  import re
> @@ -53,7 +53,7 @@
>      Works with SMTP and Google App Engine.
>      """
>
> -    class Attachment(email.MIMEBase.MIMEBase):
> +    class Attachment(MIMEBase.MIMEBase):
>          """
>          Email attachment
>
> @@ -121,12 +121,12 @@
>              filename = filename.encode(encoding)
>              if content_type == None:
>                  content_type = contenttype(filename)
> -            email.MIMEBase.MIMEBase.__init__(self, *content_type.split
> ('/', 1))
> +            MIMEBase.MIMEBase.__init__(self, *content_type.split('/',
> 1))
>              self.set_payload(payload)
>              self['Content-Disposition'] = 'attachment; filename="%s"'
> % filename
>              if content_id != None:
>                  self['Content-Id'] = '<%s>' % content_id.encode
> (encoding)
> -            email.Encoders.encode_base64(self)
> +            Encoders.encode_base64(self)
>
>      def __init__(self, server=None, sender=None, login=None,
> tls=True):
>          """
> @@ -251,7 +251,7 @@
>              to = list(to)
>          if len(to) == 0:
>              raise Exception('Target receiver address not specified')
> -        payload = email.MIMEMultipart.MIMEMultipart('related')
> +        payload = MIMEMultipart.MIMEMultipart('related')
>          payload['To'] = ', '.join(to).decode(encoding).encode
> ('utf-8')
>          if reply_to != None:
>              payload['Reply-To'] = reply_to.decode(encoding).encode
> ('utf-8')
> @@ -274,19 +274,19 @@
>              text = message
>              html = None
>          if text != None or html != None:
> -            attachment = email.MIMEMultipart.MIMEMultipart
> ('alternative')
> +            attachment = MIMEMultipart.MIMEMultipart('alternative')
>              if text != None:
>                  if isinstance(text, str):
>                      text = text.decode(encoding).encode('utf-8')
>                  else:
>                      text = text.read().decode(encoding).encode
> ('utf-8')
> -                attachment.attach(email.MIMEText.MIMEText(text))
> +                attachment.attach(MIMEText.MIMEText(text))
>              if html != None:
>                  if isinstance(html, str):
>                      html = html.decode(encoding).encode('utf-8')
>                  else:
>                      html = html.read().decode(encoding).encode
> ('utf-8')
> -                attachment.attach(email.MIMEText.MIMEText(html,
> 'html'))
> +                attachment.attach(MIMEText.MIMEText(html, 'html'))
>              payload.attach(attachment)
>          if attachments == None:
>              pass
>
> On 30 дек, 04:26, mdipierro  wrote:
>
> > Ouch! You are right. That code slipped in. I have just removed them in
> > trunk (hg only, I am having problem posting on launchpad) and will
> > repost 1.74.5 later this week.
>
> > Massimo
>
> > On Dec 29, 2:59 pm, Richard  wrote:
>
> > > I think there are a few examples in sql.py, such as lines 2928 and
> > > 2939
>
> > > On Dec 30, 1:53 am, mdipierro  wrote:
>
> > > > web2py libraries does not use (a if Condition else b) but example apps
> > > > and plugins may.
>
> > > > It works with2.4but you need some extra modules. There is an
> > > > AlterEgo entry about this.
>
> > > > On Dec 29, 7:48 am, Richard  wrote:
>
> > > > > did you manage to get web2py running with2.4? I noticed web2py uses
> > > > > (a if Condition else b), which was syntax introduced in 2.5.
> > > > > Richard
>
> > > > > On Nov 22, 11:12 am, pep

[web2py:38057] Re: Postgresql-types limited by web2py :(

2009-12-30 Thread mdipierro
Please try the version in trunk.

Massimo

On Dec 30, 1:20 am, KMax  wrote:
> This code start to work
> ===
> from gluon.sql import SQLCustomType
>
> db = DAL('postgres://web2py:gfhj...@db.sibnet.su/test1',
> pool_size=10)
> inet = SQLCustomType ( type='string',native='inet')
>
> db.define_table('firewall',
>     SQLField('network',type=inet))
> ===
> Look like
> ==from gluon.dal import SQLCustomType
> was not good idea.
> BUT
> Inserting or updating using web2py db admin
> Shows following:
> ---
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "/home/web2py/applications/test/controllers/appadmin.py", line
> 304, in 
>   File "gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/home/web2py/applications/test/controllers/appadmin.py", line
> 286, in update
>     if form.accepts(request.vars, session):
>   File "gluon/sqlhtml.py", line 896, in accepts
>     self.table._db(self.table.id == self.record.id).update(**fields)
>   File "gluon/sql.py", line 3151, in update
>     self._db._execute(query)
>   File "gluon/sql.py", line 952, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> ProgrammingError: syntax error at or near ".3"
> LINE 1: UPDATE firewall SET network=1.2.3.5 WHERE firewall.id=1;
> ===
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "/home/web2py/applications/test/controllers/appadmin.py", line
> 304, in 
>   File "gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/home/web2py/applications/test/controllers/appadmin.py", line
> 124, in insert
>     if form.accepts(request.vars, session):
>   File "gluon/sqlhtml.py", line 898, in accepts
>     self.vars.id = self.table.insert(**fields)
>   File "gluon/sql.py", line 1844, in insert
>     self._db._execute(query)
>   File "gluon/sql.py", line 952, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> ProgrammingError: syntax error at or near ".1"
> LINE 1: INSERT INTO firewall(network) VALUES (1.1.1.2);
>
> Thank you for your helping
> On Dec 30, 12:31 pm, mdipierro  wrote:
>
> > I need your help debugging this... the relevant code in sql.py is
>
> >             if isinstance(field.type,SQLCustomType):
> >                 ftype = field.type.native or field.type.type
> >             elif ...
> >             elif not field.type in self._db._translator:
> >                 raise SyntaxError, 'Field: unknown field type: %s for %s' % 
> > \
> >                     (field.type, field.name)
>
> > You get error on the last line but given the code you show me, it
> > should never get there. The first if should be true because field.type
> > should be cidr which is SQLCustomType.
>
> > Try add some print statements and see what happens.
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38056] Re: How the 'auth.settings.allow_basic_login = True' works like?

2009-12-30 Thread mdipierro
That probably will not work since it is not what was designed for.
I am not sure why it did not work thou.
If the username is the email, did you escape it?

On Dec 30, 1:16 am, David Marko  wrote:
> I simply tried to call the method with URLcontaining the username/
> password. e.g. tttp://username:p...@localhost:8080/  . Its just
> internal call so its fine that username/pwd is in URL. I simply tried
> this in browser, but login form apeared instead.
>
> David
>
> On Dec 29, 10:25 pm, mdipierro  wrote:
>
> > The allow basic login allows you to call functions that
> > @auth.requires_login() by passing the credential using basic auth for
> > example call the url using wget and curl.
>
> > How are you using it?
>
> > On Dec 29, 2:59 pm, David Marko  wrote:
>
> > > How the settings 'auth.settings.allow_basic_login = True' is supposed
> > > to work? I tried to login to protected method('@auth.requires_login
> > > ()') via basic auth, but was not succesfull. Is there some additional
> > > setting for protected methods or '@auth.requires_login()'' is simply
> > > used for both auth ? Can someone explain please?
>
> > > David
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38055] Re: web2py and python 2.4

2009-12-30 Thread ont.rif
I have found a few more problems. Below content of a patch which can
fix them.
Patched code sucessfully runs on CentOS 5.4  (web2py 1.74.4).
I drop out fixes for sql.py

diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/main.py ./2.4/
main.py
--- ./2.5/main.py   2009-12-16 12:42:47.0 +0700
+++ ./2.4/main.py   2009-12-30 16:19:47.0 +0700
@@ -29,7 +29,7 @@
 import random
 #import sneaky
 import rewrite
-import functools
+#import functools
 import string
 from restricted import RestrictedError
 from http import HTTP, redirect
@@ -212,7 +212,8 @@
 """
 response.status = str(status).split(' ',1)[0]
 response.headers = dict(headers)
-return functools.partial(response.write, escape=False)
+return lambda *args, **kargs: response.write( escape=False,
*args, **kargs )
+#return functools.partial(response.write, escape=False)


 def middleware_aux(request, response, *middleware_apps):
Только в ./2.5: python24.patch
Только в ./2.5: .sql.py.swp
diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/tools.py ./2.4/
tools.py
--- ./2.5/tools.py  2009-12-23 02:48:17.0 +0700
+++ ./2.4/tools.py  2009-12-30 16:46:48.0 +0700
@@ -17,7 +17,7 @@
 import base64
 import cPickle
 import datetime
-import email
+from email import *
 import sys
 import os
 import re
@@ -53,7 +53,7 @@
 Works with SMTP and Google App Engine.
 """

-class Attachment(email.MIMEBase.MIMEBase):
+class Attachment(MIMEBase.MIMEBase):
 """
 Email attachment

@@ -121,12 +121,12 @@
 filename = filename.encode(encoding)
 if content_type == None:
 content_type = contenttype(filename)
-email.MIMEBase.MIMEBase.__init__(self, *content_type.split
('/', 1))
+MIMEBase.MIMEBase.__init__(self, *content_type.split('/',
1))
 self.set_payload(payload)
 self['Content-Disposition'] = 'attachment; filename="%s"'
% filename
 if content_id != None:
 self['Content-Id'] = '<%s>' % content_id.encode
(encoding)
-email.Encoders.encode_base64(self)
+Encoders.encode_base64(self)

 def __init__(self, server=None, sender=None, login=None,
tls=True):
 """
@@ -251,7 +251,7 @@
 to = list(to)
 if len(to) == 0:
 raise Exception('Target receiver address not specified')
-payload = email.MIMEMultipart.MIMEMultipart('related')
+payload = MIMEMultipart.MIMEMultipart('related')
 payload['To'] = ', '.join(to).decode(encoding).encode
('utf-8')
 if reply_to != None:
 payload['Reply-To'] = reply_to.decode(encoding).encode
('utf-8')
@@ -274,19 +274,19 @@
 text = message
 html = None
 if text != None or html != None:
-attachment = email.MIMEMultipart.MIMEMultipart
('alternative')
+attachment = MIMEMultipart.MIMEMultipart('alternative')
 if text != None:
 if isinstance(text, str):
 text = text.decode(encoding).encode('utf-8')
 else:
 text = text.read().decode(encoding).encode
('utf-8')
-attachment.attach(email.MIMEText.MIMEText(text))
+attachment.attach(MIMEText.MIMEText(text))
 if html != None:
 if isinstance(html, str):
 html = html.decode(encoding).encode('utf-8')
 else:
 html = html.read().decode(encoding).encode
('utf-8')
-attachment.attach(email.MIMEText.MIMEText(html,
'html'))
+attachment.attach(MIMEText.MIMEText(html, 'html'))
 payload.attach(attachment)
 if attachments == None:
 pass


On 30 дек, 04:26, mdipierro  wrote:
> Ouch! You are right. That code slipped in. I have just removed them in
> trunk (hg only, I am having problem posting on launchpad) and will
> repost 1.74.5 later this week.
>
> Massimo
>
> On Dec 29, 2:59 pm, Richard  wrote:
>
> > I think there are a few examples in sql.py, such as lines 2928 and
> > 2939
>
> > On Dec 30, 1:53 am, mdipierro  wrote:
>
> > > web2py libraries does not use (a if Condition else b) but example apps
> > > and plugins may.
>
> > > It works with2.4but you need some extra modules. There is an
> > > AlterEgo entry about this.
>
> > > On Dec 29, 7:48 am, Richard  wrote:
>
> > > > did you manage to get web2py running with2.4? I noticed web2py uses
> > > > (a if Condition else b), which was syntax introduced in 2.5.
> > > > Richard
>
> > > > On Nov 22, 11:12 am, pepe_eloy  wrote:
>
> > > > > Returning to the theme about installhashlibin python2.4,, excuse my
> > > > > ignorance, but is it possible to install these packages in a shared
> > > > > environment? (assuming I do not have root access)
>
> > > > > Regards
>
> > > > > Jose Eloy Torres

--

You received this message because you are subscribed to the Google Groups 
"web2p