Re: [web2py] How to pass an array from jQuery to controller

2011-08-31 Thread Bruno Rocha
I dont know if this is the best approach, but I juste tested here and works.

On Wed, Aug 31, 2011 at 2:17 AM, Noel Villamor noe...@gmail.com wrote:

 I wanted to pass an array from jQuery to a controller.

 script
 var xyz= ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
 $(function() {
 $(body).click(function(event) {

  ajax({{=URL('default','mycontroller')}}+?array=+xyz,[],'target');

});
 });
 /script

 the above will call this url:
/default/mycontroller?array=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']



 def mycontroller():
# Here, I wanted to receive xyz as an array.


  myarray = eval(request.vars.array)


the above will receive the string and evaluate as a Python list.

(BUT, BE CAREFUL!! it can be used to crash your app)

another solution may be better than the above, is to split the array as args
and pass it separated.

script

var xyz= ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
args = xyz.join(/)

 $(function() {
 $(body).click(function(event) {
ajax({{=URL('default','mycontroller')}}+args ,[],'target');

 });
});

/script

the url will be called as

/default/mycontroller/Sun/Mon/Tue/Wed/Thu/'Fri/Sat

in controller

def mycrontroller():

array = request.args
array[0] # Sun

The second approach is better ans safe.
-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
Do you have these errors only with the scheduler?
Does everything else in web2py works well?

I am rewriting the scheduler completely but there seems problems with
the multiprocessing module.
I think the problem is due to this:
http://stackoverflow.com/questions/3405397/python-multiprocessing-does-not-work


Massimo

On Aug 30, 11:25 pm, Brian M bmere...@gmail.com wrote:
 Similar results with a fresh install of Python 2.7.2 I don't think this is
 just due to a bad python install.


[web2py] Re: Bug or future ?

2011-08-31 Thread brushek
And that's clear to me right now, Thank You :) !

Regards,
brushek

On 31 Sie, 02:22, Anthony abasta...@gmail.com wrote:
 On Tuesday, August 30, 2011 6:42:20 PM UTC-4, brushek wrote:

  On 31 Sie, 00:03, Bruno Rocha rocha...@gmail.com wrote:
   as far as I know, this line db.dog.owner.requires=IS_IN_DB(db, '
  person.id')
   is responsible for the dropdown widget.

   It is a validator, but using it implies the use of widget.

   if you do not use the IS_IN_DB(..) you will have no widget, then will be
   only a text box field to input the id.

  Hm... So You suggests, that if I remove the line
  db.dog.owner.requires=IS_IN_DB(db, 'person.id') I should get
  in form generated by SQLFORM text box ? If so, then something is
  wrong, because I get the select box with numbers (id's from person
  table).

 Because db.dog.owner is a reference field, it automatically gets the
 following validator by default:

 db.dog.owner.requires=IS_IN_DB(db, 'person.id', db.person._format)

 So, by default, it uses db.person._format (which in this case is
 '%(name)s'), which displays the names instead of the ids. However, you have
 overridden the default validator with your own IS_IN_DB, but you did not
 specify a format. If you don't specify a format in IS_IN_DB, it defaults to
 '%(id)s', which is why you see ids instead of names.

 Anthony


Re: [web2py] Re: Storing logged on user in database

2011-08-31 Thread pbreit
Also, just saw thus other thread which mentions that fields with a reference 
get an aotmatic is_in_db validator: 
https://groups.google.com/forum/m/#!topic/web2py/so3zcg1FvUI


Re: [web2py] Re: testing scheduler in windows

2011-08-31 Thread António Ramos
i reported the same problem.
Web2py works very well so far except this sheduler.
I have windows 7 machine and python 2.6 and 2.7





2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com

 Do you have these errors only with the scheduler?
 Does everything else in web2py works well?

 I am rewriting the scheduler completely but there seems problems with
 the multiprocessing module.
 I think the problem is due to this:

 http://stackoverflow.com/questions/3405397/python-multiprocessing-does-not-work


 Massimo

 On Aug 30, 11:25 pm, Brian M bmere...@gmail.com wrote:
  Similar results with a fresh install of Python 2.7.2 I don't think this
 is
  just due to a bad python install.



[web2py] To when a calendar widget

2011-08-31 Thread António Ramos
hello, i see a lot of discussion about the smartgrid.

I think a smartCalendar is also very usefull

I´m using fullcalendar javascript library in web2py but maybe YOU can do
better and simpler.


Is there any toughts about this?


Thank you
António


[web2py] Encoded string and parsing with TAG() helper error

2011-08-31 Thread amphisia pui
Hi to All,

I need to write a wrapper between a web2py application and a php one.
The php application is after a login form so I would like

1) get login form
2) parse login form
3) post username, password and data obtained in 2)
4) use web2py how  a user could do using a browser


This is the plan but I got stuck on 2) because of:

  import requests
 url = http://www.google.com;
 page = requests.get(url)
 page.status_code
200
 type(page.content)
type 'str'
 page_parsed = TAG(page.content)
Traceback (most recent call last):
  File input, line 1, in module
  File /Studio/web2py/gluon/html.py, line 1037, in __call__
return web2pyHTMLParser(decoder.decoder(html)).tree
  File /Studio/web2py/gluon/decoder.py, line 74, in decoder
return buffer.decode(encoding).encode('utf8')
  File /usr/lib64/python2.7/encodings/utf_8.py, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe0 in position 6561:
invalid continuation byte

What is the better way to parse non ascii html strings using web2py tools?

I know about beautiful soup but I'd rather have an slim python installation
if I could.

Thanks

AP


[web2py] Priorities for web2py applications?

2011-08-31 Thread Henri Heinonen
Hi!

Is it possible to set priorities for web2py applications?

I am running a web2py server with some simulation applications. When I
run them, the welcome application works very sluggishly so it seems to
a visitor of my web2py server that the server (or at least the welcome
page section) is down. I would like to set the priority of the welcome
application as high as possible.


[web2py] Timeout limit for applications?

2011-08-31 Thread Henri Heinonen
Is it possible to set a timeout limit for applications that seem to
run forever and forever?


[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
Did the previous version work?

On Aug 31, 4:11 am, António Ramos ramstei...@gmail.com wrote:
 i reported the same problem.
 Web2py works very well so far except this sheduler.
 I have windows 7 machine and python 2.6 and 2.7

 2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com







  Do you have these errors only with the scheduler?
  Does everything else in web2py works well?

  I am rewriting the scheduler completely but there seems problems with
  the multiprocessing module.
  I think the problem is due to this:

 http://stackoverflow.com/questions/3405397/python-multiprocessing-doe...

  Massimo

  On Aug 30, 11:25 pm, Brian M bmere...@gmail.com wrote:
   Similar results with a fresh install of Python 2.7.2 I don't think this
  is
   just due to a bad python install.


[web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Hi!

I really can't get this done, please, any help is welcome.

Consider that I have this tables:

# models/db.py #

db.define_table('auth_user' ... )

db.define_table('estados_postulacion',
Field('nombre'),
Field('descripcion'),
format='[%(id)s] %(nombre)s')

db.define_table('postulaciones',
Field('proceso_postulacion', db.proceso_postulacion),
Field('postulante', db.auth_user, default=user_id),
Field('fecha_postulacion', 'datetime', default=request.now),
Field('estado_postulacion', requires=IS_IN_DB(db, 'estados_postulacion.id', 
'%(nombre)s'),
  represent=lambda r:db.estados_postulacion[r].nombre))

###

The represent attribute defined there only work for SQLTABLE but I don't 
need a table in my view.

How I can to define a represent in a controller for the field: 
db.postulaciones.estado_postulacion ?

I need that this represent work in my view:
represent=lambda r:db.estados_postulacion[r].nombre


Thanks a lot!


Re: [web2py] define represent in a Controller

2011-08-31 Thread Bruno Rocha
you can define a represent in controller before creating the table or form.

db.table.field.represent = lambda .

But, if you want to display the representation of a field without a table or
form, do:

{{=myrows.mycolumn.represent()}}


Re: [web2py] Re: testing scheduler in windows

2011-08-31 Thread António Ramos
the -K option is only for 2.6 but with python  2.6 i have that screenshot
with error until i break it with ctrl c
after that the task runs only the first time and not the other 2 as your
demo on Vimeo


Thanks

2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com

 Did the previous version work?

 On Aug 31, 4:11 am, António Ramos ramstei...@gmail.com wrote:
  i reported the same problem.
  Web2py works very well so far except this sheduler.
  I have windows 7 machine and python 2.6 and 2.7
 
  2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com
 
 
 
 
 
 
 
   Do you have these errors only with the scheduler?
   Does everything else in web2py works well?
 
   I am rewriting the scheduler completely but there seems problems with
   the multiprocessing module.
   I think the problem is due to this:
 
  http://stackoverflow.com/questions/3405397/python-multiprocessing-doe.
 ..
 
   Massimo
 
   On Aug 30, 11:25 pm, Brian M bmere...@gmail.com wrote:
Similar results with a fresh install of Python 2.7.2 I don't think
 this
   is
just due to a bad python install.



[web2py] Python Tools for Visual Studio – version 1.0!

2011-08-31 Thread ionel
http://pytools.codeplex.com/


[web2py] Re: Python Tools for Visual Studio – version 1.0!

2011-08-31 Thread ionel
Supports CPython and IronPython

On Aug 31, 10:04 am, ionel ionelanton...@gmail.com wrote:
 http://pytools.codeplex.com/


[web2py] Re: Useful validators IS_LETTERS, IS_DIGITS

2011-08-31 Thread Rufus
Since the two functions are subsets of IS_ALPHANUMERIC(), I'd suggest
that the sub-functions be named:

IS_ALPHA()
and
IS_NUMERIC()


On Aug 28, 2:56 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 28, 2011, at 11:23 AM, Saurabh Sawant wrote:

  They seem fine. Although, having ready to use validators would save
  some time for those learning the framework. I personally expected
  those validators to be already there while I was learning.

 Trouble is, there's an endless list of pattern expressions that can be 
 useful. IS_MATCH is pretty powerful, and should be in your bag of tricks (in 
 fact, IS_ALPHANUMERIC just calls IS_MATCH).

 At the very least, consider that you might want a language-dependent 
 IS_LETTERS, or at least one that accepts the common alphabetic variants.

 However, if you do that, do it this way:

 IS_MATCH('[0-9]+', strict=True)
 IS_MATCH('[a-zA-Z]+', strict=True)

 strict=True forces a $ at the end of the regex. Or you can just include the 
 $. (IS_MATCH is already anchored at the beginning of the string.)









  On Aug 28, 11:05 pm, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:
  what's wrong with?

  IS_MATCH('[0-9]+')
  IS_MATCH('[a-zA-Z]+')

  On Aug 28, 12:59 pm, Saurabh  Sawant ris...@gmail.com wrote:

  But IS_ALPHANUMERIC by virtue of its name suggests both letters and
  numbers. Having separate validators for each of the cases would make
  the code more readable.

  db.auth_user.first_name.requires=IS_LETTERS()
  db.auth_user.age.requires=IS_DIGITS()


Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Thanks Bruno!

I'm doing something wrong:

*my controller*:

def index():
db.postulaciones.estado_postulacion.represent = lambda 
r:db.estados_postulacion[r].nombre
lista_postulaciones = db(db.postulaciones.postulante == 
db.auth_user.id).select()

return dict( lista_postulaciones = lista_postulaciones)

*my view:*
*
*
table class=data
 tr
 thID /th
 thFecha de Postulación/th
 thEstado/th
 thNombres/th
 thApellido Paterno/th
 thApellido Materno/th
 thVer Postulación/th
 /tr
 {{for postulacion in lista_postulaciones:}}
 tr
 td{{=postulacion.postulaciones.id}}/td

 td{{=postulacion.postulaciones.fecha_postulacion}}/td

 td{{=postulacion.postulaciones.estado_postulacion}}/td
 td{{=postulacion.auth_user.first_name}}/td
 td{{=postulacion.auth_user.last_name}}/td
 td{{=postulacion.auth_user.apellido_materno}}/td
 td{{=A('VER POSTULACIÓN', _href=URL(r=request, 
f='ver_postulacion', args=postulacion.postulaciones.id))}}/td

 /tr
 {{pass}}
 /table

*and I get this:*

IDFecha de PostulaciónEstadoNombresApellido PaternoApellido MaternoVer 
Postulación62011-08-03 12:53:151PepeArayaBossaVER POSTULACIÓN



Thank you for your help!

[web2py] Re: Mobile detector

2011-08-31 Thread Ross Peoples
Sorry guys, the hurricane did a number on the east coast and I haven't been 
able to keep up with the conversations. Good work yet again Angelo! I like 
the @mobilize decorator.

Re: [web2py] define represent in a Controller

2011-08-31 Thread Bruno Rocha
does it work for you?

 td{{=postulacion.postulaciones.estado_postulacion.*represent()*}}/td


Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
I get this error:

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



Re: [web2py] define represent in a Controller

2011-08-31 Thread Bruno Rocha
Sorry, I am wrong.. the correct should be

{{represent = postulacion.postulaciones.estado_postulacion.*represent*}}

 td{{=*represent(postulacion)*}}/td


[web2py] Re: Python Tools for Visual Studio – version 1.0!

2011-08-31 Thread David Marko
Is it working with Visual Studio Express version?

Re: [web2py] To when a calendar widget

2011-08-31 Thread Richard Vézina
What's about anytime widget of kenji4569  :
http://dev.s-cubism.com/plugin_anytime_widget

http://groups.google.com/group/web2py/browse_thread/thread/b6056d5d6daf6b21/b238b7a30b53332e?show_docid=b238b7a30b53332epli=1

Richard

2011/8/31 António Ramos ramstei...@gmail.com

 hello, i see a lot of discussion about the smartgrid.

 I think a smartCalendar is also very usefull

 I´m using fullcalendar javascript library in web2py but maybe YOU can do
 better and simpler.


 Is there any toughts about this?


 Thank you
 António



Re: [web2py] To when a calendar widget

2011-08-31 Thread António Ramos
no,
something more like FullCalendar
http://arshaw.com/fullcalendar/




2011/8/31 Richard Vézina ml.richard.vez...@gmail.com

 What's about anytime widget of kenji4569  :
 http://dev.s-cubism.com/plugin_anytime_widget


 http://groups.google.com/group/web2py/browse_thread/thread/b6056d5d6daf6b21/b238b7a30b53332e?show_docid=b238b7a30b53332epli=1

 Richard

 2011/8/31 António Ramos ramstei...@gmail.com

 hello, i see a lot of discussion about the smartgrid.

 I think a smartCalendar is also very usefull

 I´m using fullcalendar javascript library in web2py but maybe YOU can do
 better and simpler.


 Is there any toughts about this?


 Thank you
 António





Re: [web2py] Re: Python Tools for Visual Studio – version 1.0!

2011-08-31 Thread Vasile Ermicioi
no, but it works with free VS shell


Re: [web2py] To when a calendar widget

2011-08-31 Thread Richard Vézina
Oh, yeah you right... I have this on my todo list since a lot of time and
make it integrated with FULLCalendar as well...

Are you willing to work on this with me?

Richard

2011/8/31 António Ramos ramstei...@gmail.com

 no,
 something more like FullCalendar
 http://arshaw.com/fullcalendar/




 2011/8/31 Richard Vézina ml.richard.vez...@gmail.com

 What's about anytime widget of kenji4569  :
 http://dev.s-cubism.com/plugin_anytime_widget


 http://groups.google.com/group/web2py/browse_thread/thread/b6056d5d6daf6b21/b238b7a30b53332e?show_docid=b238b7a30b53332epli=1

 Richard

 2011/8/31 António Ramos ramstei...@gmail.com

 hello, i see a lot of discussion about the smartgrid.

 I think a smartCalendar is also very usefull

 I´m using fullcalendar javascript library in web2py but maybe YOU can do
 better and simpler.


 Is there any toughts about this?


 Thank you
 António






[web2py] Re: GAE select all does not iterate

2011-08-31 Thread Arbie Samong
Update: Following christian's example, it seems that looping over the
Rows object in controller does nothing, but looping over it on the
view is working.

My controllers and models are almost exactly the same, at least the
fields that are affected. I am testing on localhost:8080 first,
although same results in GAE production. I print out stuff on
localhost:8080, it works although it breaks the page and displays
withing pre tags (ala php die ;-P), so I can see variables. I can
see the Rows object and the fetched records, but when I iterate over
them nothing happens.

# controller
profiles =
db(db.userprofile.created).select(orderby=~db.userprofile.created,
limitby=(0,20))
print profiles # no problem, I see the profiles object
print len(profiles) # still OK

for profile in profiles:
  print profile # here nothing happens

# view
h1profiles/h1
{{for profile in profiles:}}
  {{=profile.title}}br /
{{pass}}

Now I'm not sure if this is a bug, but I would appreciate a way for me
to make it work on the controller side because I'll need to fetch
stuff that spans a couple of tables, and that would nicely fit in the
controller instead of the view.


Thanks,
Arbie

On Aug 29, 3:24 am, howesc how...@umich.edu wrote:
 here is what i just tried:

 db.define_table('menu_item',
   Field('created_on','datetime', default=request.now,writable=False),
   Field('name', length=500, notnull=True, unique=True,
         requires=IS_NOT_IN_DB(db, 'menu_item.name')),
   migrate=migrate)

 then in controller:

 def index():

 data=db(db.menu_item.created_on).select(orderby=~db.menu_item.created_on,
 limitby=(0,20))

     data2=db().select(db.menu_item.ALL,orderby=~db.menu_item.created_on,
 limitby=(0,20))

     return dict(data=data, data2=data2)

 then in view:

 {{=BEAUTIFY(response._vars)}}

 h1data/h1
 {{for d in data:}}
   {{=d.name}}br /
 {{pass}}

 hr /
 h1data2/h1
 {{for d in data2:}}
   {{=d.name}}br /
 {{pass}}

 and got exactly what i was expecting.  some things i noticed:
  - i don't think db(db.menu_item.created_on) is a valid query.  it needs to
 be compared to something right?  (i know it works, but it seems wrong to me)
  - print doesn't work on GAE (there is no console to output to in that
 environment) so i assumed you were either using logging or outputting in a
 view

 can you tell me more, or send me a minimal application that produces the
 problem and i'll try it out too?  it sounds like something is up, so let's
 get to the bottom of it and get it fixed!

 christian

On Aug 29, 3:24 am, howesc how...@umich.edu wrote:
 here is what i just tried:

 db.define_table('menu_item',
   Field('created_on','datetime', default=request.now,writable=False),
   Field('name', length=500, notnull=True, unique=True,
         requires=IS_NOT_IN_DB(db, 'menu_item.name')),
   migrate=migrate)

 then in controller:

 def index():

 data=db(db.menu_item.created_on).select(orderby=~db.menu_item.created_on,
 limitby=(0,20))

     data2=db().select(db.menu_item.ALL,orderby=~db.menu_item.created_on,
 limitby=(0,20))

     return dict(data=data, data2=data2)

 then in view:

 {{=BEAUTIFY(response._vars)}}

 h1data/h1
 {{for d in data:}}
   {{=d.name}}br /
 {{pass}}

 hr /
 h1data2/h1
 {{for d in data2:}}
   {{=d.name}}br /
 {{pass}}

 and got exactly what i was expecting.  some things i noticed:
  - i don't think db(db.menu_item.created_on) is a valid query.  it needs to
 be compared to something right?  (i know it works, but it seems wrong to me)
  - print doesn't work on GAE (there is no console to output to in that
 environment) so i assumed you were either using logging or outputting in a
 view

 can you tell me more, or send me a minimal application that produces the
 problem and i'll try it out too?  it sounds like something is up, so let's
 get to the bottom of it and get it fixed!

 christian


Re: [web2py] To when a calendar widget

2011-08-31 Thread António Ramos
I´d love to help, but i´n new in web2py stuff and javascript related stuff

However feel free to slave me in any task you want.

I´m here to learn .


António




2011/8/31 Richard Vézina ml.richard.vez...@gmail.com

 Oh, yeah you right... I have this on my todo list since a lot of time and
 make it integrated with FULLCalendar as well...

 Are you willing to work on this with me?

 Richard

 2011/8/31 António Ramos ramstei...@gmail.com

 no,
 something more like FullCalendar
 http://arshaw.com/fullcalendar/




 2011/8/31 Richard Vézina ml.richard.vez...@gmail.com

 What's about anytime widget of kenji4569  :
 http://dev.s-cubism.com/plugin_anytime_widget


 http://groups.google.com/group/web2py/browse_thread/thread/b6056d5d6daf6b21/b238b7a30b53332e?show_docid=b238b7a30b53332epli=1

 Richard

 2011/8/31 António Ramos ramstei...@gmail.com

 hello, i see a lot of discussion about the smartgrid.

 I think a smartCalendar is also very usefull

 I´m using fullcalendar javascript library in web2py but maybe YOU can do
 better and simpler.


 Is there any toughts about this?


 Thank you
 António







Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
In that way it not work, but I tried this:

{{for postulacion in lista_postulaciones:}}
 {{represent =*db.postulaciones.estado_postulacion.represent
*}}
 tr
 td{{=postulacion.postulaciones.id}}/td

 td{{=postulacion.postulaciones.fecha_postulacion}}/td
 td{{=represent(*
postulacion.postulaciones.estado_postulacion*)}}/td

and it works :)

Thanks a lot!

ps: is this the right way or the best way to do it?


[web2py] auth_user fields writable/readable False

2011-08-31 Thread annet
I have two fields in the auth_user table which I don't want to be
visible when the user edits his profile. In def user(): I set:

def user():

if request.args(0)=='profile':
db.auth_user.comment.readable=False
db.auth_user.comment.writable=False
db.auth_user.reply.readable=False
db.auth_user.reply.writable=False

return dict(form=form)

However, this doesn't work the fields are still shown. What is the
correct way to achieve this.


Kind regards,

Annet.


Re: [web2py] define represent in a Controller

2011-08-31 Thread Bruno Rocha
you can put the attribution outside the loop, this will always be the same.

{{represent =* db.postulaciones.estado_postulacion.represent*}}
{{for postulacion in lista_postulaciones:}}
 tr
 td{{=postulacion.postulaciones.id}}/td

 td{{=postulacion.postulaciones.fecha_postulacion}}/td
 td{{=represent(*
postulacion.postulaciones.estado_postulacion*)}}/td

On Wednesday, August 31, 2011, Pepe Araya wrote:

 In that way it not work, but I tried this:

 {{for postulacion in lista_postulaciones:}}
  {{represent =*db.postulaciones.estado_postulacion.represent
 *}}
  tr
  td{{=postulacion.postulaciones.id}}/td

  td{{=postulacion.postulaciones.fecha_postulacion}}/td
  td{{=represent(*
 postulacion.postulaciones.estado_postulacion*)}}/td

 and it works :)

 Thanks a lot!

 ps: is this the right way or the best way to do it?



-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] auth_user fields writable/readable False

2011-08-31 Thread Bruno Rocha
are you creating the form object before or after this?

You need to specify attributes before the creation of the form object.

db.table.field.readable = False
form = FORM()
return dict(form=form)

My way of doing it

  if 'register' in request.args:
auth_user_opt =
['twitter','facebook','photo_source','profilename','gender','photo','bio','phone','homepage','user_types','birthdate','privacy']
for field in auth_user_opt:
db.auth_user[field].readable = db.auth_user[field].writable =
False

On Wednesday, August 31, 2011, annet wrote:

 I have two fields in the auth_user table which I don't want to be
 visible when the user edits his profile. In def user(): I set:

 def user():

if request.args(0)=='profile':
db.auth_user.comment.readable=False
db.auth_user.comment.writable=False
db.auth_user.reply.readable=False
db.auth_user.reply.writable=False

return dict(form=form)

 However, this doesn't work the fields are still shown. What is the
 correct way to achieve this.


 Kind regards,

 Annet.



-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] auth_user fields writable/readable False

2011-08-31 Thread Richard Vézina
http://web2py.com/book/default/chapter/08?search=setting#Customizing-Auth

Maybe you can try at the model level?

Also if you define your auth tables and rename it you maybe have to use the
new name... Not sure of that actually.

Richard

On Wed, Aug 31, 2011 at 1:05 PM, annet annet.verm...@gmail.com wrote:

 I have two fields in the auth_user table which I don't want to be
 visible when the user edits his profile. In def user(): I set:

 def user():

if request.args(0)=='profile':
db.auth_user.comment.readable=False
db.auth_user.comment.writable=False
db.auth_user.reply.readable=False
db.auth_user.reply.writable=False

return dict(form=form)

 However, this doesn't work the fields are still shown. What is the
 correct way to achieve this.


 Kind regards,

 Annet.


Re: [web2py] auth_user fields writable/readable False

2011-08-31 Thread Bruno Rocha
You can also do:

auth.settings.profile_fields = ['first_name','last_name','email']  # a list
with fields and the order you want to bw shown in profile page.


-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Thanks!
I'm very grateful for your help!

I have only one more question: in which cases is right to define this in the 
controller?

You says:

you can define a represent in controller before creating the table or form.
db.table.field.represent = lambda .

that is for Table and Form Helpers?

Anew, thanks very much for your time and help! 



Re: [web2py] define represent in a Controller

2011-08-31 Thread Bruno Rocha
 I have only one more question: in which cases is right to define this in
the controller?

There is no rule, when the thing is global define in model, when is specific
to an action define it in the action.

represent works for crud,read ans crud.select forms, and some widgets also
uses it.


-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] mssql connect

2011-08-31 Thread patrick moon
I'm using the doc suggested connection string:

db =  DAL('mssql://shxxx:shaxxx@POPE:1433/xPAC')

and this is the error I'm getting:

Traceback (most recent call last):
  File gluon/restricted.py, line 192, in restricted
  File C:/_dev/temp/web2py/applications/welcome/models/db.py, line
18, in module
  File gluon/dal.py, line 3981, in __init__
RuntimeError: Failure to connect, tried 5 times:
'NoneType' object has no attribute 'connect'

Appreciate any help


[web2py] How can i create my own CAS provider?

2011-08-31 Thread nekrox
I have some apps and use the same database for share a auth system. I
prefer to use CAS and have my own provider for my apps, but do not
quite understand how to do as the documentation says, someone will
have an example?

Regards


Re: [web2py] CAS Auth redirect loop

2011-08-31 Thread Bruno Rocha
Bump!

Any news about it?

I tried to change almost everything, but still enters in redirect loop..


-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: mssql connect

2011-08-31 Thread DenesL

The connection string seems ok but:
- check user and password
- leave out the port (1433 is the default)
- if yo are using the Express version add the instance name e.g.
POPE\\SQLEXPRESS/xPAC


On Aug 31, 2:25 pm, patrick moon pmo...@gmail.com wrote:
 I'm using the doc suggested connection string:

 db =  DAL('mssql://shxxx:shaxxx@POPE:1433/xPAC')

 and this is the error I'm getting:

 Traceback (most recent call last):
   File gluon/restricted.py, line 192, in restricted
   File C:/_dev/temp/web2py/applications/welcome/models/db.py, line
 18, in module
   File gluon/dal.py, line 3981, in __init__
 RuntimeError: Failure to connect, tried 5 times:
 'NoneType' object has no attribute 'connect'

 Appreciate any help


[web2py] Re: mssql connect

2011-08-31 Thread Willoughby
Also check to make sure it's loading the MSSQL database driver.
You have to run from source, the binary doesn't have it:
http://www.web2py.com/book/default/chapter/06#Dependencies


Re: [web2py] Re: Storing logged on user in database

2011-08-31 Thread Chris Rowson
 Good to hear.
 It's possible using auth.user_id might also fix it like that.
 This is what it says in the book:
 auth.user contains a copy of the db.auth_user records for the current logged
 in user or None otherwise. There is also also a auth.user_id which is the
 same as auth.user.id (i.e. the id of the current logger in user) or None.


I've replaced my early change with auth.user_id and that works too.

Thank you :-)

Chris


Re: [web2py] Re: Published my collection of plugins

2011-08-31 Thread Richard Vézina
Hello,

I just try anydate plugin... It works great except that it seems to conflict
with jQuery UI tabs and dialog... It no show up when my form are called with
LOAD(), so it also could it be conflicting with LOAD() of web2py.  Also
there is no way we can move it like the actual datepicker...

Richard



On Tue, Aug 30, 2011 at 9:47 PM, kenji4569 hos...@s-cubism.jp wrote:

  I still see the same
  problem with 'Format', 'Font size' and 'Font' dropdown selections.
 Sorry, I addressed the issue, and I think it would be fixed.
 The cause for this is null entry for the text area.

 Kenji


 On 8月31日, 午前12:14, tomt tom_tren...@yahoo.com wrote:
  Hi,
 
  I tried your update, and I can now successfully modify text color and
  background color with IE7 and IE8. Unfortunately I still see the same
  problem with 'Format', 'Font size' and 'Font' dropdown selections.
  That is,
  the dropdown selection is erased before I can select an option.
 
  - Tom
 
  On Aug 30, 4:05 am, kenji4569 hos...@s-cubism.jp wrote:
 
 
 
 
 
 
 
   Hi, Tom.
 
   Thank you for reporting the bug.
   I just fixed it.
   Please check:http://dev.s-cubism.com/plugin_elrte_widget
   (you might need to clear the browser cache)
 
   [modification detail]
   I upgraded theelrteversion from 1.2 to 1.3.
   Additionally, since the version 1.3 had a serious IE problem, I
   applied some patches for it.
   I also slightly modified the plugin css not to conflict with the site
   css.
   (https://github.com/kenji4569/sqlabs/issues/39)
 
   Kenji
 
   On 8月30日, 午前11:38, tomt tom_tren...@yahoo.com wrote:
 
Hi,
 
Thanks for the great contributions to web2py.  I'm looking forward to
trying them.
 
I implemented web2py.plugin.elrte_widget.w2p and while it worked
 great
with firefox, I had some problems using internet explorer.
Specifically, the dropdown boxes, such as the colorpicker, disappear
before I can make a selection.
 
This happened with IE7 and IE8.  I used the same IE browser to go to
thehttp://elrte.org/demoandtheproblem didn't exist there. Does
anyone else see this problem?
 
- Tom- Hide quoted text -
 
   - Show quoted text -



[web2py] Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread TheSweetlink
I would like to build an interface between web2py and OrientDB.  It's
a NOSQL document-graph database with some astonishing features.  See
http://www.orientechnologies.com for full details.

I have been communicating between the two via the requests python lib
and OrientDB's RESTful interface.  The really cool part is that it
uses SQL syntax so it could be a great fit for web2py.

A professionally done interface between the two (intended to be
released as a web2py plugin) would bring a great deal of power to
web2py's already ample capabilities.

As I understand it, and please forgive any ignorance on my part, a
class in a module should do the trick.  Then import the module
whenever communication is needed between web2py and OrientDB.  This
would allow me to keep everything related to communication between the
two in one convenient place.  Error handling and such in one place
should clean up a lot of my code.

As a relative newcomer to web2py I would appreciate any guidance as to
the best approach to go about building such an interface so as to
avoid making a noob-tastic mistake and have to do it all over again.

More specifically, what do you think would be the best approach to
adapt a RESTful OrientDB server to DAL's awesomeness?  Security is a
large concern of mine and DAL's auto-escaping of input plus everything
else it does would bring me peace of mind.

Thank you in advance for your help and time.

-David Bloom


Re: [web2py] Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread Vasile Ermicioi
inside dal.py you will find many dal adapters,

as I see, OrientDB is often compared to MongoDB
http://vschart.com/compare/orientdb/vs/mongodb
I think you may take a look at mongodb adapter (it is unstable, or not
proven stable)

I am open to contribute with testing and/or development of such adapter


[web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread TheSweetlink
Thanks for your quick reply Vasile.  I am truly impressed with this
community.

There are some interesting comparisons between MongoDB and OrientDB.
I chose Orient for my project because of the graph capabilities on top
of its document capabilities.

The mongo adapter is probably a good starting point and thank you for
your willingness to test/contribute.

Another question, do you know how web2py does the renaming/uploading
of files?  I'm trying to determine which would be the best approach
between:

1) Use binary and store images/videos directly in OrientDB

2) Use mysql/postgres to store images because web2py already handles
renaming and uploading of file, then reference it from OrientDB.

I'll post here as soon as I have an update on the adapter's progress.

-David Bloom


Re: [web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread Vasile Ermicioi
if you/we write the adapter, it should work the same way as other adapters

that means you have 2 options:
- you can store file on disk
- you can store the file on another field (of type blob) in the same table

no need for other database


Re: [web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread Vasile Ermicioi
btw, did you test orientdb in production, or at least some performance tests
against other databases?


[web2py] Mapping URLS in routes.py

2011-08-31 Thread Andrew Evans
Hello I have the following in my routes.py file but its not mapping the
second domain to the web2py project any ideas whats up?

routers = dict(

# base router
BASE = dict(
default_application = 'cheer10s',
domains = {
'cheer10s.com' : 'cheer10s',
'kidify.org' : 'kidify'
},
applications = ['cheer10s','kidify','admin'],
controllers = 'DEFAULT'
),
)

*cheers


Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote:

 Hello I have the following in my routes.py file but its not mapping the 
 second domain to the web2py project any ideas whats up?
 
 routers = dict(
 
 # base router
 BASE = dict(
 default_application = 'cheer10s',
 domains = {
 'cheer10s.com' : 'cheer10s',
 'kidify.org' : 'kidify'
 },
 applications = ['cheer10s','kidify','admin'],
 controllers = 'DEFAULT'
 ),
 )

If you turn off routing, can you get to web2py via kidify.org? The router can 
only route requests that get to web2py in the first place.

[web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread TheSweetlink
Strangely I didn't even consider using strictly OrientDB as up until
now I have been using mysql or postgres for login/profile actions and
OrientDB for the rest.  It would be wonderful to use OrientDB for the
entire application.

Storing on disk would be nice for me but OrientDB has a binary type
field that I think would convert it to a base64 string.  How does
web2py do the renaming and other security things to an upload field?

Redarding development I am interested and open to collaborating but
first must check with my counsel as this is for a project which only I
can develop for.
Ideally, we could collaborate on this and give the community another
DB choice in the web2py realm.

Thank you again Vasile for your smart, speedy responses and
enthusiasm.

-David Bloom


On Aug 31, 4:10 pm, Vasile Ermicioi elff...@gmail.com wrote:
 if you/we write the adapter, it should work the same way as other adapters

 that means you have 2 options:
 - you can store file on disk
 - you can store the file on another field (of type blob) in the same table

 no need for other database


[web2py] Re: Howto change request.uri_language through URL function?

2011-08-31 Thread Alexander Cabezas
Christopher

Did you make this website? http://www.amnesty.org/fr/how-you-can-help

Did you build it with web2py?

How could I do the same thing in my application?

On 29 ago, 23:40, Christopher Steel chris.st...@gmail.com wrote:
 So something like this:

    http://www.amnesty.org/fr/how-you-can-help

 and not this:

    http://voiceofaccess.org/init/default/index?_language=fr-ca

 ?


Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Andrew Evans
Hey well for some reason its working now *confused

Anyway I won't complain ty for the advice

This is a great forum :-)

On Wed, Aug 31, 2011 at 1:36 PM, Jonathan Lundell jlund...@pobox.comwrote:

 On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote:

 Hello I have the following in my routes.py file but its not mapping the
 second domain to the web2py project any ideas whats up?

 routers = dict(

 # base router
 BASE = dict(
 default_application = 'cheer10s',
 domains = {
 'cheer10s.com' : 'cheer10s',
 'kidify.org' : 'kidify'
 },
 applications = ['cheer10s','kidify','admin'],
 controllers = 'DEFAULT'
 ),
 )


 If you turn off routing, can you get to web2py via kidify.org? The router
 can only route requests that get to web2py in the first place.



[web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-08-31 Thread TheSweetlink
I have not run OrientDB in production but spent the last month
converting my application from mysql -- Orient.  I know that Luca
Garulli has been developing this since 1999 or '97 or so and that it's
made available under the Apache 2.0 license.

He has personally responded quite helpfully to my questions as well as
many others very promptly on several occaisons.

With regards to performance OrientDB is supposedly an absolute
monster.  Their benchmarks had a single server storing 150,000 -
200,000 per second on a modest server!
This is because the graph part of the database eliminates the need for
JOINS to relate your data.  The relation is directly attatched to
whatever it is you are relating to something else.

My experience testing on a very small scale during my app. conversion
has shown OrientDB pulling data I need in 1-7 milliseconds where mysql
took about 80-90.

Combined with Gremlin the graph traversal language, the SQL syntax of
OrientDB + Gremlin allows powerful analysis of your data.

As more performance comparisons become available I will post them.

-David Bloom


On Aug 31, 4:11 pm, Vasile Ermicioi elff...@gmail.com wrote:
 btw, did you test orientdb in production, or at least some performance tests
 against other databases?


Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 1:50 PM, Andrew Evans wrote:

 Hey well for some reason its working now *confused

Keep in mind that you need to restart web2py (or at least reload the router 
configuration) for changes to take effect. That can be confusing, too.

 
 Anyway I won't complain ty for the advice
 
 This is a great forum :-)
 
 On Wed, Aug 31, 2011 at 1:36 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote:
 
 Hello I have the following in my routes.py file but its not mapping the 
 second domain to the web2py project any ideas whats up?
 
 routers = dict(
 
 # base router
 BASE = dict(
 default_application = 'cheer10s',
 domains = {
 'cheer10s.com' : 'cheer10s',
 'kidify.org' : 'kidify'
 },
 applications = ['cheer10s','kidify','admin'],
 controllers = 'DEFAULT'
 ),
 )
 
 If you turn off routing, can you get to web2py via kidify.org? The router can 
 only route requests that get to web2py in the first place.
 




[web2py] Re: mssql connect

2011-08-31 Thread Omi Chiba
Additonal to Denes,

I'm using Microsoft SQL Server 2008 Express and successfully
connection with this.

db = DAL(mssql://UserID:Password@ComputerName\SQLEXPRESS/
DatabaseName)

On Aug 31, 1:52 pm, DenesL denes1...@yahoo.ca wrote:
 The connection string seems ok but:
 - check user and password
 - leave out the port (1433 is the default)
 - if yo are using the Express version add the instance name e.g.
 POPE\\SQLEXPRESS/xPAC

 On Aug 31, 2:25 pm, patrick moon pmo...@gmail.com wrote:







  I'm using the doc suggested connection string:

  db =  DAL('mssql://shxxx:shaxxx@POPE:1433/xPAC')

  and this is the error I'm getting:

  Traceback (most recent call last):
    File gluon/restricted.py, line 192, in restricted
    File C:/_dev/temp/web2py/applications/welcome/models/db.py, line
  18, in module
    File gluon/dal.py, line 3981, in __init__
  RuntimeError: Failure to connect, tried 5 times:
  'NoneType' object has no attribute 'connect'

  Appreciate any help


[web2py] Re: CAS Auth redirect loop

2011-08-31 Thread Jay
The only comment I have is that there may be problem in the code at
redirect. Raising an exception in redirect does not seem to work. I
would look there.
My $.02.

Jay


[web2py] SQLFORM validator question

2011-08-31 Thread Chris Rowson
Hi folks,

I'm having a bit of mental blank.

I'm trying to create a validator in the model for a postcode entry in
SQLFORM to strip all spaces and non-alphanumeric characters like this:

db.data.postcode.requires=[IS_NOT_EMPTY(), CLEANUP([48-57,65-90,97-122])]

I'm getting the following error:

type 'exceptions.TypeError'(unhashable type: 'list')

What am I doing wrong? :-S

Thanks

Chris


[web2py] Re: SQLFORM validator question

2011-08-31 Thread Anthony
CLEANUP does not actually take a list of ascii codes as an argument. 
Instead, it takes a regular expression, which defaults 
to '[^\x09\x0a\x0d\x20-\x7e]'.

Anthony

On Wednesday, August 31, 2011 5:18:43 PM UTC-4, leftcase wrote:

 Hi folks,

 I'm having a bit of mental blank.

 I'm trying to create a validator in the model for a postcode entry in
 SQLFORM to strip all spaces and non-alphanumeric characters like this:

 db.data.postcode.requires=[IS_NOT_EMPTY(), CLEANUP([48-57,65-90,97-122])]

 I'm getting the following error:

 type 'exceptions.TypeError'(unhashable type: 'list')

 What am I doing wrong? :-S

 Thanks

 Chris



Re: [web2py] Re: New Plugin: plugin_ckeditor

2011-08-31 Thread António Ramos
I did this 
download the model, the controller, the view, and the static plugin_ckeditor
folder to your project.

and when i browse  to default/index i get this error



Traceback (most recent call last):
File gluon/restricted.py, line 192, in restricted
File D:/web2py198_2/web2py/applications/a1/models/db.py, line 83, in
module
File gluon/custom_import.py, line 280, in __call__
File gluon/custom_import.py, line 74, in __call__
ImportError: No module named plugin_ckeditor



What am i missing?

thank you




2011/7/15 Ross Peoples ross.peop...@gmail.com

 From BitBucket, download the model, the controller, the view, and the
 static plugin_ckeditor folder to your project.


Re: [web2py] Re: SQLFORM validator question

2011-08-31 Thread Chris Rowson
Ah cool.

Thanks,

Chris

On Wed, Aug 31, 2011 at 10:30 PM, Anthony abasta...@gmail.com wrote:
 CLEANUP does not actually take a list of ascii codes as an argument.
 Instead, it takes a regular expression, which defaults
 to '[^\x09\x0a\x0d\x20-\x7e]'.
 Anthony

 On Wednesday, August 31, 2011 5:18:43 PM UTC-4, leftcase wrote:

 Hi folks,

 I'm having a bit of mental blank.

 I'm trying to create a validator in the model for a postcode entry in
 SQLFORM to strip all spaces and non-alphanumeric characters like this:

 db.data.postcode.requires=[IS_NOT_EMPTY(), CLEANUP([48-57,65-90,97-122])]

 I'm getting the following error:

 type 'exceptions.TypeError'(unhashable type: 'list')

 What am I doing wrong? :-S

 Thanks

 Chris



Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Andrew Evans
Actually I figured it out

in my routes.py I had set the domain to kidify.org which was directing it if
I went to http://kidify.org but not if I typed http://www.kidify,org

after adding a second entry so www. was entered it made it work flawlessly
:D

*cheers

On Wed, Aug 31, 2011 at 1:55 PM, Jonathan Lundell jlund...@pobox.comwrote:

 On Aug 31, 2011, at 1:50 PM, Andrew Evans wrote:

 Hey well for some reason its working now *confused


 Keep in mind that you need to restart web2py (or at least reload the router
 configuration) for changes to take effect. That can be confusing, too.


 Anyway I won't complain ty for the advice

 This is a great forum :-)

 On Wed, Aug 31, 2011 at 1:36 PM, Jonathan Lundell jlund...@pobox.comwrote:

 On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote:

 Hello I have the following in my routes.py file but its not mapping the
 second domain to the web2py project any ideas whats up?

 routers = dict(

 # base router
 BASE = dict(
 default_application = 'cheer10s',
 domains = {
 'cheer10s.com' : 'cheer10s',
 'kidify.org' : 'kidify'
 },
 applications = ['cheer10s','kidify','admin'],
 controllers = 'DEFAULT'
 ),
 )


 If you turn off routing, can you get to web2py via kidify.org? The router
 can only route requests that get to web2py in the first place.







[web2py] Re: GAE select all does not iterate

2011-08-31 Thread Massimo Di Pierro
I am not sure where you are printing to (console, logs, html page) but
one problem may be that if you view the output into an HTML document
rows are displayed as Row {...} and your browser thinks this is a
tag, does not understand it and makes it invisible.

On Aug 31, 11:19 am, Arbie Samong phek...@gmail.com wrote:
 Update: Following christian's example, it seems that looping over the
 Rows object in controller does nothing, but looping over it on the
 view is working.

 My controllers and models are almost exactly the same, at least the
 fields that are affected. I am testing on localhost:8080 first,
 although same results in GAE production. I print out stuff on
 localhost:8080, it works although it breaks the page and displays
 withing pre tags (ala php die ;-P), so I can see variables. I can
 see the Rows object and the fetched records, but when I iterate over
 them nothing happens.

 # controller
 profiles =
 db(db.userprofile.created).select(orderby=~db.userprofile.created,
 limitby=(0,20))
 print profiles # no problem, I see the profiles object
 print len(profiles) # still OK

 for profile in profiles:
   print profile # here nothing happens

 # view
 h1profiles/h1
 {{for profile in profiles:}}
   {{=profile.title}}br /
 {{pass}}

 Now I'm not sure if this is a bug, but I would appreciate a way for me
 to make it work on the controller side because I'll need to fetch
 stuff that spans a couple of tables, and that would nicely fit in the
 controller instead of the view.

 Thanks,
 Arbie

 On Aug 29, 3:24 am, howesc how...@umich.edu wrote:









  here is what i just tried:

  db.define_table('menu_item',
    Field('created_on','datetime', default=request.now,writable=False),
    Field('name', length=500, notnull=True, unique=True,
          requires=IS_NOT_IN_DB(db, 'menu_item.name')),
    migrate=migrate)

  then in controller:

  def index():

  data=db(db.menu_item.created_on).select(orderby=~db.menu_item.created_on,
  limitby=(0,20))

      data2=db().select(db.menu_item.ALL,orderby=~db.menu_item.created_on,
  limitby=(0,20))

      return dict(data=data, data2=data2)

  then in view:

  {{=BEAUTIFY(response._vars)}}

  h1data/h1
  {{for d in data:}}
    {{=d.name}}br /
  {{pass}}

  hr /
  h1data2/h1
  {{for d in data2:}}
    {{=d.name}}br /
  {{pass}}

  and got exactly what i was expecting.  some things i noticed:
   - i don't think db(db.menu_item.created_on) is a valid query.  it needs to
  be compared to something right?  (i know it works, but it seems wrong to me)
   - print doesn't work on GAE (there is no console to output to in that
  environment) so i assumed you were either using logging or outputting in a
  view

  can you tell me more, or send me a minimal application that produces the
  problem and i'll try it out too?  it sounds like something is up, so let's
  get to the bottom of it and get it fixed!

  christian

 On Aug 29, 3:24 am, howesc how...@umich.edu wrote:







  here is what i just tried:

  db.define_table('menu_item',
    Field('created_on','datetime', default=request.now,writable=False),
    Field('name', length=500, notnull=True, unique=True,
          requires=IS_NOT_IN_DB(db, 'menu_item.name')),
    migrate=migrate)

  then in controller:

  def index():

  data=db(db.menu_item.created_on).select(orderby=~db.menu_item.created_on,
  limitby=(0,20))

      data2=db().select(db.menu_item.ALL,orderby=~db.menu_item.created_on,
  limitby=(0,20))

      return dict(data=data, data2=data2)

  then in view:

  {{=BEAUTIFY(response._vars)}}

  h1data/h1
  {{for d in data:}}
    {{=d.name}}br /
  {{pass}}

  hr /
  h1data2/h1
  {{for d in data2:}}
    {{=d.name}}br /
  {{pass}}

  and got exactly what i was expecting.  some things i noticed:
   - i don't think db(db.menu_item.created_on) is a valid query.  it needs to
  be compared to something right?  (i know it works, but it seems wrong to me)
   - print doesn't work on GAE (there is no console to output to in that
  environment) so i assumed you were either using logging or outputting in a
  view

  can you tell me more, or send me a minimal application that produces the
  problem and i'll try it out too?  it sounds like something is up, so let's
  get to the bottom of it and get it fixed!

  christian


[web2py] Re: How can i create my own CAS provider?

2011-08-31 Thread Massimo Di Pierro
def user(): return dict(form=auth())

exposes the CAS provider. There is nothing special to do as long as
the consumer run on the same domain.

On Aug 31, 1:38 pm, nekrox nek...@gmail.com wrote:
 I have some apps and use the same database for share a auth system. I
 prefer to use CAS and have my own provider for my apps, but do not
 quite understand how to do as the documentation says, someone will
 have an example?

 Regards


[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
Trying to isolate the problem... can any windows user run the
following test for me?

get trunk
cd web2py/gluon
python2.6 meta_scheduler.py

(python 2.7 should be ok too)
you should get the following text repeated ...
--- begin 
starting task
task started
thum
thum
thum
thum
thum
reporting task
--- end ---
after a few cycles press [ctrl+c]. Do you get a traceback? Do all new
task - reporting task pair up in the output?

Massimo

On Aug 31, 8:45 am, António Ramos ramstei...@gmail.com wrote:
 the -K option is only for 2.6 but with python  2.6 i have that screenshot
 with error until i break it with ctrl c
 after that the task runs only the first time and not the other 2 as your
 demo on Vimeo

 Thanks

 2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com







  Did the previous version work?

  On Aug 31, 4:11 am, António Ramos ramstei...@gmail.com wrote:
   i reported the same problem.
   Web2py works very well so far except this sheduler.
   I have windows 7 machine and python 2.6 and 2.7

   2011/8/31 Massimo Di Pierro massimo.dipie...@gmail.com

Do you have these errors only with the scheduler?
Does everything else in web2py works well?

I am rewriting the scheduler completely but there seems problems with
the multiprocessing module.
I think the problem is due to this:

   http://stackoverflow.com/questions/3405397/python-multiprocessing-doe.
  ..

Massimo

On Aug 30, 11:25 pm, Brian M bmere...@gmail.com wrote:
 Similar results with a fresh install of Python 2.7.2 I don't think
  this
is
 just due to a bad python install.


[web2py] Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
To reproduce, create a view with the ff contents:

style type=text/css
td {
border-width: 5px;
border-color: #80;
border-style: solid;
}
/style

{{arr=['second','third']}}
{{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}


HTML result:

table
tbody
tr
tdfirst/td
td/td   -- This extra td should not be here
tdsecond/td
tdthird/td
/tr
/tbody
/table


Remarks:

The bug does not show if there is no TD before the TD array. Thus, the
following is OK.
{{=TABLE(TR([TD(x) for x in arr]))}}



[web2py] Re: testing scheduler in windows

2011-08-31 Thread Anthony
On Windows 7 with Python 2.7, I get an immediate traceback, and then the 
thum's start -- but it just keeps going without getting to a reporting 
task. Here's the entire output (I broke this one after 11 thum's, but ran 
another one for over 30 thum's):

thumnew task

starting task
Traceback (most recent call last):
  File meta_scheduler.py, line 140, in module
MetaScheduler().loop()
  File meta_scheduler.py, line 133, in loop
self.report_task(task,self.async(task))
  File meta_scheduler.py, line 56, in async
p.start()
  File C:\Python27\lib\multiprocessing\process.py, line 104, in start
self._popen = Popen(self)
  File C:\Python27\lib\multiprocessing\forking.py, line 244, in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File C:\Python27\lib\multiprocessing\forking.py, line 167, in dump
ForkingPickler(file, protocol).dump(obj)
  File C:\Python27\lib\pickle.py, line 224, in dump
self.save(obj)
  File C:\Python27\lib\pickle.py, line 331, in save
self.save_reduce(obj=obj, *rv)
  File C:\Python27\lib\pickle.py, line 419, in save_reduce
save(state)
  File C:\Python27\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\pickle.py, line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
save(v)
  File C:\Python27\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\multiprocessing\forking.py, line 40, in dispatcher
self.save_reduce(obj=obj, *rv)
  File C:\Python27\lib\pickle.py, line 401, in save_reduce
save(args)
  File C:\Python27\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\pickle.py, line 548, in save_tuple
save(element)
  File C:\Python27\lib\pickle.py, line 331, in save
self.save_reduce(obj=obj, *rv)
  File C:\Python27\lib\pickle.py, line 419, in save_reduce
save(state)
  File C:\Python27\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\pickle.py, line 649, in save_dict
Traceback (most recent call last):
  File string, line 1, in module
self._batch_setitems(obj.iteritems())
  File C:\Python27\lib\multiprocessing\forking.py, line 347, in main
  File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
self = load(from_parent)
save(v)
  File C:\Python27\lib\pickle.py, line 1378, in load
  File C:\Python27\lib\pickle.py, line 331, in save
return Unpickler(file).load()
self.save_reduce(obj=obj, *rv)
  File C:\Python27\lib\pickle.py, line 858, in load
  File C:\Python27\lib\pickle.py, line 419, in save_reduce
save(state)
  File C:\Python27\lib\pickle.py, line 286, in save
dispatch[key](self)
  File C:\Python27\lib\pickle.py, line 880, in load_eof
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\pickle.py, line 649, in save_dict
raise EOFError
EOFError
self._batch_setitems(obj.iteritems())
  File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
save(v)
  File C:\Python27\lib\pickle.py, line 331, in save
self.save_reduce(obj=obj, *rv)
  File C:\Python27\lib\pickle.py, line 396, in save_reduce
save(cls)
  File C:\Python27\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python27\lib\pickle.py, line 748, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as 
thread.lock
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
^C


Anthony


On Wednesday, August 31, 2011 7:39:51 PM UTC-4, Massimo Di Pierro wrote:

 Trying to isolate the problem... can any windows user run the 
 following test for me? 

 get trunk 
 cd web2py/gluon 
 python2.6 meta_scheduler.py 

 (python 2.7 should be ok too) 
 you should get the following text repeated ... 
 --- begin  
 starting task 
 task started 
 thum 
 thum 
 thum 
 thum 
 thum 
 reporting task 
 --- end --- 
 after a few cycles press [ctrl+c]. Do you get a traceback? Do all new 
 task - reporting task pair up in the output? 

 Massimo 

 On Aug 31, 8:45 am, António Ramos ramst...@gmail.com wrote: 
  the -K option is only for 2.6 but with python  2.6 i have that screenshot 

  with error until i break it with ctrl c 
  after that the task runs only the first time and not the other 2 as your 
  demo on Vimeo 
  
  Thanks 
  
  2011/8/31 Massimo Di Pierro massimo@gmail.com 
  
  
  
  
  
  
  
   Did the previous version work? 
  
   On Aug 31, 4:11 am, António Ramos ramst...@gmail.com wrote: 
i reported the same problem. 
Web2py works very well so far except this sheduler. 
I have windows 7 machine and python 2.6 and 2.7 
  
2011/8/31 Massimo Di Pierro massimo@gmail.com 
  
 Do you have these errors only with the scheduler? 
 Does everything else in web2py 

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Anthony
The problem is you are passing a list of TD's to TR instead of individual 
TD's. Instead, try this:

{{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}} 


Notice the * before the list comprehension -- that converts the list to a 
set of positional arguments.

Anthony


On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

 To reproduce, create a view with the ff contents: 

 style type=text/css 
 td { 
 border-width: 5px; 
 border-color: #80; 
 border-style: solid; 
 } 
 /style 

 {{arr=['second','third']}} 
 {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}} 


 HTML result: 

 table 
 tbody 
 tr 
 tdfirst/td 
 td/td   -- This extra td should not be here 
 tdsecond/td 
 tdthird/td 
 /tr 
 /tbody 
 /table 


 Remarks: 

 The bug does not show if there is no TD before the TD array. Thus, the 
 following is OK. 
 {{=TABLE(TR([TD(x) for x in arr]))}} 



[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor

Just when I thought I have helped find a bug, I am faced with the
revelation that I need to hone my python some more. He he he.

Thanks Anthony.


On Sep 1, 12:18 pm, Anthony abasta...@gmail.com wrote:
 The problem is you are passing a list of TD's to TR instead of individual
 TD's. Instead, try this:

 {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}

 Notice the * before the list comprehension -- that converts the list to a
 set of positional arguments.

 Anthony







 On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

  To reproduce, create a view with the ff contents:

  style type=text/css
  td {
  border-width: 5px;
  border-color: #80;
  border-style: solid;
  }
  /style

  {{arr=['second','third']}}
  {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

  HTML result:

  table
  tbody
  tr
  tdfirst/td
  td/td       -- This extra td should not be here
  tdsecond/td
  tdthird/td
  /tr
  /tbody
  /table

  Remarks:

  The bug does not show if there is no TD before the TD array. Thus, the
  following is OK.
  {{=TABLE(TR([TD(x) for x in arr]))}}


[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor

By the way, the reason why I stumbled on this is because I wanted to
add a fourth TD to my test case.

{{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}}
or more simply
{{=TABLE(TR(TD('first'),*arr,TD('fourth')))}}

But, this results to
SyntaxError: only named arguments may follow *expression

The syntax appears reasonable to me. Perhaps in the future, developers
would consider allowing this.

On Sep 1, 12:31 pm, Noel Villamor noe...@gmail.com wrote:
 Just when I thought I have helped find a bug, I am faced with the
 revelation that I need to hone my python some more. He he he.

 Thanks Anthony.

 On Sep 1, 12:18 pm, Anthony abasta...@gmail.com wrote:







  The problem is you are passing a list of TD's to TR instead of individual
  TD's. Instead, try this:

  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}

  Notice the * before the list comprehension -- that converts the list to a
  set of positional arguments.

  Anthony

  On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

   To reproduce, create a view with the ff contents:

   style type=text/css
   td {
   border-width: 5px;
   border-color: #80;
   border-style: solid;
   }
   /style

   {{arr=['second','third']}}
   {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

   HTML result:

   table
   tbody
   tr
   tdfirst/td
   td/td       -- This extra td should not be here
   tdsecond/td
   tdthird/td
   /tr
   /tbody
   /table

   Remarks:

   The bug does not show if there is no TD before the TD array. Thus, the
   following is OK.
   {{=TABLE(TR([TD(x) for x in arr]))}}


[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Anthony
By the way, the reason you got the output you did is because TR expects its 
positional arguments to be TD's, and if they are not, it wraps them in a TD. 
In your case, your second positional argument was a list, so TR wrapped it 
in a TD for you (it turned out that your list itself contained two TD's, so 
they ended up inside another TD).

Anthony

On Wednesday, August 31, 2011 8:31:09 PM UTC-4, Noel Villamor wrote:


 Just when I thought I have helped find a bug, I am faced with the 
 revelation that I need to hone my python some more. He he he. 

 Thanks Anthony. 


 On Sep 1, 12:18 pm, Anthony abas...@gmail.com wrote: 
  The problem is you are passing a list of TD's to TR instead of individual 

  TD's. Instead, try this: 
  
  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}} 
  
  Notice the * before the list comprehension -- that converts the list to 
 a 
  set of positional arguments. 
  
  Anthony 
  
  
  
  
  
  
  
  On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote: 
  
   To reproduce, create a view with the ff contents: 
  
   style type=text/css 
   td { 
   border-width: 5px; 
   border-color: #80; 
   border-style: solid; 
   } 
   /style 
  
   {{arr=['second','third']}} 
   {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}} 
  
   HTML result: 
  
   table 
   tbody 
   tr 
   tdfirst/td 
   td/td   -- This extra td should not be here 
   tdsecond/td 
   tdthird/td 
   /tr 
   /tbody 
   /table 
  
   Remarks: 
  
   The bug does not show if there is no TD before the TD array. Thus, the 
   following is OK. 
   {{=TABLE(TR([TD(x) for x in arr]))}}



Re: [web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote:

 
 By the way, the reason why I stumbled on this is because I wanted to
 add a fourth TD to my test case.
 
 {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}}
 or more simply
 {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}}
 
 But, this results to
 SyntaxError: only named arguments may follow *expression
 
 The syntax appears reasonable to me. Perhaps in the future, developers
 would consider allowing this.

You can, I think, supply a list of TDs to TR. The problem in your example is 
that you had a bare TD followed by a list of TDs.

Instead of 

{{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

you could probably have said this:

{{=TABLE(TR([TD('first')] + [TD(x) for x in arr]))}}


 
 On Sep 1, 12:31 pm, Noel Villamor noe...@gmail.com wrote:
 Just when I thought I have helped find a bug, I am faced with the
 revelation that I need to hone my python some more. He he he.
 
 Thanks Anthony.
 
 On Sep 1, 12:18 pm, Anthony abasta...@gmail.com wrote:
 
 
 
 
 
 
 
 The problem is you are passing a list of TD's to TR instead of individual
 TD's. Instead, try this:
 
 {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}
 
 Notice the * before the list comprehension -- that converts the list to a
 set of positional arguments.
 
 Anthony
 
 On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:
 
 To reproduce, create a view with the ff contents:
 
 style type=text/css
 td {
 border-width: 5px;
 border-color: #80;
 border-style: solid;
 }
 /style
 
 {{arr=['second','third']}}
 {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}
 
 HTML result:
 
 table
 tbody
 tr
 tdfirst/td
 td/td   -- This extra td should not be here
 tdsecond/td
 tdthird/td
 /tr
 /tbody
 /table
 
 Remarks:
 
 The bug does not show if there is no TD before the TD array. Thus, the
 following is OK.
 {{=TABLE(TR([TD(x) for x in arr]))}}




[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
Following what you said, I would have expected the html result to be:

tr
tdfirst/td
td
tdsecond/td
tdthird/td
/td
/tr

In any case, the following syntax would have been a work-around for
the SyntaxError: only named arguments may follow *expression but
only if the extra td wasn't there.
{{=TABLE(TR(TD('first'),[TD(x) for x in arr],TD('fourth')))}}



On Sep 1, 12:53 pm, Anthony abasta...@gmail.com wrote:
 By the way, the reason you got the output you did is because TR expects its
 positional arguments to be TD's, and if they are not, it wraps them in a TD.
 In your case, your second positional argument was a list, so TR wrapped it
 in a TD for you (it turned out that your list itself contained two TD's, so
 they ended up inside another TD).

 Anthony







 On Wednesday, August 31, 2011 8:31:09 PM UTC-4, Noel Villamor wrote:

  Just when I thought I have helped find a bug, I am faced with the
  revelation that I need to hone my python some more. He he he.

  Thanks Anthony.

  On Sep 1, 12:18 pm, Anthony abas...@gmail.com wrote:
   The problem is you are passing a list of TD's to TR instead of individual

   TD's. Instead, try this:

   {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}

   Notice the * before the list comprehension -- that converts the list to
  a
   set of positional arguments.

   Anthony

   On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

To reproduce, create a view with the ff contents:

style type=text/css
td {
border-width: 5px;
border-color: #80;
border-style: solid;
}
/style

{{arr=['second','third']}}
{{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

HTML result:

table
tbody
tr
tdfirst/td
td/td       -- This extra td should not be here
tdsecond/td
tdthird/td
/tr
/tbody
/table

Remarks:

The bug does not show if there is no TD before the TD array. Thus, the
following is OK.
{{=TABLE(TR([TD(x) for x in arr]))}}


[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor

Anthony, you surely have another way to killl the cat:

{{=TABLE(TR([TD('first')]+[TD(x) for x in arr]+[TD('fourth')]))}}

Thanks for that.

Noel


On Sep 1, 12:55 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote:



  By the way, the reason why I stumbled on this is because I wanted to
  add a fourth TD to my test case.

  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}}
  or more simply
  {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}}

  But, this results to
  SyntaxError: only named arguments may follow *expression

  The syntax appears reasonable to me. Perhaps in the future, developers
  would consider allowing this.

 You can, I think, supply a list of TDs to TR. The problem in your example is 
 that you had a bare TD followed by a list of TDs.

 Instead of

 {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

 you could probably have said this:

 {{=TABLE(TR([TD('first')] + [TD(x) for x in arr]))}}









  On Sep 1, 12:31 pm, Noel Villamor noe...@gmail.com wrote:
  Just when I thought I have helped find a bug, I am faced with the
  revelation that I need to hone my python some more. He he he.

  Thanks Anthony.

  On Sep 1, 12:18 pm, Anthony abasta...@gmail.com wrote:

  The problem is you are passing a list of TD's to TR instead of individual
  TD's. Instead, try this:

  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}

  Notice the * before the list comprehension -- that converts the list to 
  a
  set of positional arguments.

  Anthony

  On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

  To reproduce, create a view with the ff contents:

  style type=text/css
  td {
  border-width: 5px;
  border-color: #80;
  border-style: solid;
  }
  /style

  {{arr=['second','third']}}
  {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

  HTML result:

  table
  tbody
  tr
  tdfirst/td
  td/td       -- This extra td should not be here
  tdsecond/td
  tdthird/td
  /tr
  /tbody
  /table

  Remarks:

  The bug does not show if there is no TD before the TD array. Thus, the
  following is OK.
  {{=TABLE(TR([TD(x) for x in arr]))}}


[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
Can you try again?

On Aug 31, 7:10 pm, Anthony abasta...@gmail.com wrote:
 On Windows 7 with Python 2.7, I get an immediate traceback, and then the
 thum's start -- but it just keeps going without getting to a reporting
 task. Here's the entire output (I broke this one after 11 thum's, but ran
 another one for over 30 thum's):

 thumnew task

 starting task
 Traceback (most recent call last):
   File meta_scheduler.py, line 140, in module
     MetaScheduler().loop()
   File meta_scheduler.py, line 133, in loop
     self.report_task(task,self.async(task))
   File meta_scheduler.py, line 56, in async
     p.start()
   File C:\Python27\lib\multiprocessing\process.py, line 104, in start
     self._popen = Popen(self)
   File C:\Python27\lib\multiprocessing\forking.py, line 244, in __init__
     dump(process_obj, to_child, HIGHEST_PROTOCOL)
   File C:\Python27\lib\multiprocessing\forking.py, line 167, in dump
     ForkingPickler(file, protocol).dump(obj)
   File C:\Python27\lib\pickle.py, line 224, in dump
     self.save(obj)
   File C:\Python27\lib\pickle.py, line 331, in save
     self.save_reduce(obj=obj, *rv)
   File C:\Python27\lib\pickle.py, line 419, in save_reduce
     save(state)
   File C:\Python27\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\pickle.py, line 649, in save_dict
     self._batch_setitems(obj.iteritems())
   File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
     save(v)
   File C:\Python27\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\multiprocessing\forking.py, line 40, in dispatcher
     self.save_reduce(obj=obj, *rv)
   File C:\Python27\lib\pickle.py, line 401, in save_reduce
     save(args)
   File C:\Python27\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\pickle.py, line 548, in save_tuple
     save(element)
   File C:\Python27\lib\pickle.py, line 331, in save
     self.save_reduce(obj=obj, *rv)
   File C:\Python27\lib\pickle.py, line 419, in save_reduce
     save(state)
   File C:\Python27\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\pickle.py, line 649, in save_dict
 Traceback (most recent call last):
   File string, line 1, in module
     self._batch_setitems(obj.iteritems())
   File C:\Python27\lib\multiprocessing\forking.py, line 347, in main
   File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
         self = load(from_parent)
 save(v)
   File C:\Python27\lib\pickle.py, line 1378, in load
   File C:\Python27\lib\pickle.py, line 331, in save
         return Unpickler(file).load()
 self.save_reduce(obj=obj, *rv)
   File C:\Python27\lib\pickle.py, line 858, in load
   File C:\Python27\lib\pickle.py, line 419, in save_reduce
     save(state)
   File C:\Python27\lib\pickle.py, line 286, in save
     dispatch[key](self)
       File C:\Python27\lib\pickle.py, line 880, in load_eof
 f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\pickle.py, line 649, in save_dict
     raise EOFError
 EOFError
 self._batch_setitems(obj.iteritems())
   File C:\Python27\lib\pickle.py, line 681, in _batch_setitems
     save(v)
   File C:\Python27\lib\pickle.py, line 331, in save
     self.save_reduce(obj=obj, *rv)
   File C:\Python27\lib\pickle.py, line 396, in save_reduce
     save(cls)
   File C:\Python27\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python27\lib\pickle.py, line 748, in save_global
     (obj, module, name))
 pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as
 thread.lock
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 ^C

 Anthony







 On Wednesday, August 31, 2011 7:39:51 PM UTC-4, Massimo Di Pierro wrote:

  Trying to isolate the problem... can any windows user run the
  following test for me?

  get trunk
  cd web2py/gluon
  python2.6 meta_scheduler.py

  (python 2.7 should be ok too)
  you should get the following text repeated ...
  --- begin 
  starting task
  task started
  thum
  thum
  thum
  thum
  thum
  reporting task
  --- end ---
  after a few cycles press [ctrl+c]. Do you get a traceback? Do all new
  task - reporting task pair up in the output?

  Massimo

  On Aug 31, 8:45 am, António Ramos ramst...@gmail.com wrote:
   the -K option is only for 2.6 but with python  2.6 i have that screenshot

   with error until i break it with ctrl c
   after that the task runs only the first time and not the other 2 as your
   demo on Vimeo

   Thanks

   2011/8/31 Massimo Di Pierro massimo@gmail.com

Did the previous version work?

On Aug 31, 4:11 am, António Ramos ramst...@gmail.com wrote:
 i reported the same problem.
 Web2py works very well so far except this sheduler.
 I have windows 7 machine and python 2.6 and 2.7

 

[web2py] Re: testing scheduler in windows

2011-08-31 Thread Brian M
OK, just pulled from trunk and trying with Python 2.6.4 on win7 - still no 
luck though the traceback seems slightly different now.


C:\Users\Brian\Documents\development\web2py\google hg repopython 
trunk/gluon/me
ta_scheduler.py
thumnew task

starting task
Traceback (most recent call last):
  File trunk/gluon/meta_scheduler.py, line 139, in module
MetaScheduler().loop()
  File trunk/gluon/meta_scheduler.py, line 132, in loop
self.report_task(task,self.async(task))
  File trunk/gluon/meta_scheduler.py, line 55, in async
p.start()
  File C:\Python26\lib\multiprocessing\process.py, line 104, in start
self._popen = Popen(self)
  File C:\Python26\lib\multiprocessing\forking.py, line 239, in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
ForkingPickler(file, protocol).dump(obj)
  File C:\Python26\lib\pickle.py, line 224, in dump
self.save(obj)
  File C:\Python26\lib\pickle.py, line 331, in save
self.save_reduce(obj=obj, *rv)
  File C:\Python26\lib\pickle.py, line 419, in save_reduce
save(state)
  File C:\Python26\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python26\lib\pickle.py, line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
save(v)
  File C:\Python26\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python26\lib\pickle.py, line 748, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle function executor at 0x0152AC30: it's 
not f
ound as __main__.executor
Traceback (most recent call last):
  File string, line 1, in module
  File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
self = load(from_parent)
  File C:\Python26\lib\pickle.py, line 1370, in load
return Unpickler(file).load()
t  File C:\Python26\lib\pickle.py, line 858, in load
hum
dispatch[key](self)
  File C:\Python26\lib\pickle.py, line 880, in load_eof
raise EOFError
EOFError
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum
thum




[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
one more test please... :-)

On Aug 31, 8:28 pm, Brian M bmere...@gmail.com wrote:
 OK, just pulled from trunk and trying with Python 2.6.4 on win7 - still no
 luck though the traceback seems slightly different now.

 C:\Users\Brian\Documents\development\web2py\google hg repopython
 trunk/gluon/me
 ta_scheduler.py
 thumnew task

 starting task
 Traceback (most recent call last):
   File trunk/gluon/meta_scheduler.py, line 139, in module
     MetaScheduler().loop()
   File trunk/gluon/meta_scheduler.py, line 132, in loop
     self.report_task(task,self.async(task))
   File trunk/gluon/meta_scheduler.py, line 55, in async
     p.start()
   File C:\Python26\lib\multiprocessing\process.py, line 104, in start
     self._popen = Popen(self)
   File C:\Python26\lib\multiprocessing\forking.py, line 239, in __init__
     dump(process_obj, to_child, HIGHEST_PROTOCOL)
   File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
     ForkingPickler(file, protocol).dump(obj)
   File C:\Python26\lib\pickle.py, line 224, in dump
     self.save(obj)
   File C:\Python26\lib\pickle.py, line 331, in save
     self.save_reduce(obj=obj, *rv)
   File C:\Python26\lib\pickle.py, line 419, in save_reduce
     save(state)
   File C:\Python26\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python26\lib\pickle.py, line 649, in save_dict
     self._batch_setitems(obj.iteritems())
   File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
     save(v)
   File C:\Python26\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python26\lib\pickle.py, line 748, in save_global
     (obj, module, name))
 pickle.PicklingError: Can't pickle function executor at 0x0152AC30: it's
 not f
 ound as __main__.executor
 Traceback (most recent call last):
   File string, line 1, in module
   File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
     self = load(from_parent)
   File C:\Python26\lib\pickle.py, line 1370, in load
     return Unpickler(file).load()
 t  File C:\Python26\lib\pickle.py, line 858, in load
 hum
     dispatch[key](self)
   File C:\Python26\lib\pickle.py, line 880, in load_eof
     raise EOFError
 EOFError
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum
 thum


[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor

Jonathan, you surely have another way to killl the cat:

{{=TABLE(TR([TD('first')]+[TD(x) for x in arr]+[TD('fourth')]))}}

Thanks for that. Anthony, thanks to you as well.

Noel

On Sep 1, 12:55 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote:



  By the way, the reason why I stumbled on this is because I wanted to
  add a fourth TD to my test case.

  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}}
  or more simply
  {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}}

  But, this results to
  SyntaxError: only named arguments may follow *expression

  The syntax appears reasonable to me. Perhaps in the future, developers
  would consider allowing this.

 You can, I think, supply a list of TDs to TR. The problem in your example is 
 that you had a bare TD followed by a list of TDs.

 Instead of

 {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

 you could probably have said this:

 {{=TABLE(TR([TD('first')] + [TD(x) for x in arr]))}}









  On Sep 1, 12:31 pm, Noel Villamor noe...@gmail.com wrote:
  Just when I thought I have helped find a bug, I am faced with the
  revelation that I need to hone my python some more. He he he.

  Thanks Anthony.

  On Sep 1, 12:18 pm, Anthony abasta...@gmail.com wrote:

  The problem is you are passing a list of TD's to TR instead of individual
  TD's. Instead, try this:

  {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}}

  Notice the * before the list comprehension -- that converts the list to 
  a
  set of positional arguments.

  Anthony

  On Wednesday, August 31, 2011 8:03:48 PM UTC-4, Noel Villamor wrote:

  To reproduce, create a view with the ff contents:

  style type=text/css
  td {
  border-width: 5px;
  border-color: #80;
  border-style: solid;
  }
  /style

  {{arr=['second','third']}}
  {{=TABLE(TR(TD('first'),[TD(x) for x in arr]))}}

  HTML result:

  table
  tbody
  tr
  tdfirst/td
  td/td       -- This extra td should not be here
  tdsecond/td
  tdthird/td
  /tr
  /tbody
  /table

  Remarks:

  The bug does not show if there is no TD before the TD array. Thus, the
  following is OK.
  {{=TABLE(TR([TD(x) for x in arr]))}}


Re: [web2py] Re: testing scheduler in windows

2011-08-31 Thread Brian Meredyk
no change :(


C:\Users\Brian\Documents\development\web2py\google hg repopython
trunk/gluon/me
ta_scheduler.py
thumnew task

starting task
Traceback (most recent call last):
  File trunk/gluon/meta_scheduler.py, line 139, in module
MetaScheduler().loop()
  File trunk/gluon/meta_scheduler.py, line 132, in loop
self.report_task(task,self.async(task))
  File trunk/gluon/meta_scheduler.py, line 55, in async
p.start()
  File C:\Python26\lib\multiprocessing\process.py, line 104, in start
self._popen = Popen(self)
  File C:\Python26\lib\multiprocessing\forking.py, line 239, in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
ForkingPickler(file, protocol).dump(obj)
  File C:\Python26\lib\pickle.py, line 224, in dump
self.save(obj)
  File C:\Python26\lib\pickle.py, line 331, in save
self.save_reduce(obj=obj, *rv)
  File C:\Python26\lib\pickle.py, line 419, in save_reduce
save(state)
  File C:\Python26\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python26\lib\pickle.py, line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
save(v)
  File C:\Python26\lib\pickle.py, line 286, in save
f(self, obj) # Call unbound method with explicit self
  File C:\Python26\lib\pickle.py, line 748, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle function executor at 0x014BAC30: it's
not f
ound as __main__.executor
Traceback (most recent call last):
  File string, line 1, in module
  File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
self = load(from_parent)
  File C:\Python26\lib\pickle.py, line 1370, in load
thumreturn Unpickler(file).load()

  File C:\Python26\lib\pickle.py, line 858, in load
dispatch[key](self)
  File C:\Python26\lib\pickle.py, line 880, in load_eof
raise EOFError
EOFError
thum
thum
thum
thum
thum
thum



On Wed, Aug 31, 2011 at 8:41 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 one more test please... :-)

 On Aug 31, 8:28 pm, Brian M bmere...@gmail.com wrote:
  OK, just pulled from trunk and trying with Python 2.6.4 on win7 - still
 no
  luck though the traceback seems slightly different now.
 
  C:\Users\Brian\Documents\development\web2py\google hg repopython
  trunk/gluon/me
  ta_scheduler.py
  thumnew task
 
  starting task
  Traceback (most recent call last):
File trunk/gluon/meta_scheduler.py, line 139, in module
  MetaScheduler().loop()
File trunk/gluon/meta_scheduler.py, line 132, in loop
  self.report_task(task,self.async(task))
File trunk/gluon/meta_scheduler.py, line 55, in async
  p.start()
File C:\Python26\lib\multiprocessing\process.py, line 104, in start
  self._popen = Popen(self)
File C:\Python26\lib\multiprocessing\forking.py, line 239, in
 __init__
  dump(process_obj, to_child, HIGHEST_PROTOCOL)
File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
  ForkingPickler(file, protocol).dump(obj)
File C:\Python26\lib\pickle.py, line 224, in dump
  self.save(obj)
File C:\Python26\lib\pickle.py, line 331, in save
  self.save_reduce(obj=obj, *rv)
File C:\Python26\lib\pickle.py, line 419, in save_reduce
  save(state)
File C:\Python26\lib\pickle.py, line 286, in save
  f(self, obj) # Call unbound method with explicit self
File C:\Python26\lib\pickle.py, line 649, in save_dict
  self._batch_setitems(obj.iteritems())
File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
  save(v)
File C:\Python26\lib\pickle.py, line 286, in save
  f(self, obj) # Call unbound method with explicit self
File C:\Python26\lib\pickle.py, line 748, in save_global
  (obj, module, name))
  pickle.PicklingError: Can't pickle function executor at 0x0152AC30:
 it's
  not f
  ound as __main__.executor
  Traceback (most recent call last):
File string, line 1, in module
File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
  self = load(from_parent)
File C:\Python26\lib\pickle.py, line 1370, in load
  return Unpickler(file).load()
  t  File C:\Python26\lib\pickle.py, line 858, in load
  hum
  dispatch[key](self)
File C:\Python26\lib\pickle.py, line 880, in load_eof
  raise EOFError
  EOFError
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum
  thum



[web2py] Re: testing scheduler in windows

2011-08-31 Thread Massimo Di Pierro
Can you help me for the next 15 minutes? If so, let's take this
private and please email me.

On Aug 31, 8:50 pm, Brian Meredyk bmere...@gmail.com wrote:
 no change :(

 C:\Users\Brian\Documents\development\web2py\google hg repopython
 trunk/gluon/me
 ta_scheduler.py
 thumnew task

 starting task
 Traceback (most recent call last):
   File trunk/gluon/meta_scheduler.py, line 139, in module
     MetaScheduler().loop()
   File trunk/gluon/meta_scheduler.py, line 132, in loop
     self.report_task(task,self.async(task))
   File trunk/gluon/meta_scheduler.py, line 55, in async
     p.start()
   File C:\Python26\lib\multiprocessing\process.py, line 104, in start
     self._popen = Popen(self)
   File C:\Python26\lib\multiprocessing\forking.py, line 239, in __init__
     dump(process_obj, to_child, HIGHEST_PROTOCOL)
   File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
     ForkingPickler(file, protocol).dump(obj)
   File C:\Python26\lib\pickle.py, line 224, in dump
     self.save(obj)
   File C:\Python26\lib\pickle.py, line 331, in save
     self.save_reduce(obj=obj, *rv)
   File C:\Python26\lib\pickle.py, line 419, in save_reduce
     save(state)
   File C:\Python26\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python26\lib\pickle.py, line 649, in save_dict
     self._batch_setitems(obj.iteritems())
   File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
     save(v)
   File C:\Python26\lib\pickle.py, line 286, in save
     f(self, obj) # Call unbound method with explicit self
   File C:\Python26\lib\pickle.py, line 748, in save_global
     (obj, module, name))
 pickle.PicklingError: Can't pickle function executor at 0x014BAC30: it's
 not f
 ound as __main__.executor
 Traceback (most recent call last):
   File string, line 1, in module
   File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
     self = load(from_parent)
   File C:\Python26\lib\pickle.py, line 1370, in load
 t    humreturn Unpickler(file).load()

   File C:\Python26\lib\pickle.py, line 858, in load
     dispatch[key](self)
   File C:\Python26\lib\pickle.py, line 880, in load_eof
     raise EOFError
 EOFError
 thum
 thum
 thum
 thum
 thum
 thum

 On Wed, Aug 31, 2011 at 8:41 PM, Massimo Di Pierro 







 massimo.dipie...@gmail.com wrote:
  one more test please... :-)

  On Aug 31, 8:28 pm, Brian M bmere...@gmail.com wrote:
   OK, just pulled from trunk and trying with Python 2.6.4 on win7 - still
  no
   luck though the traceback seems slightly different now.

   C:\Users\Brian\Documents\development\web2py\google hg repopython
   trunk/gluon/me
   ta_scheduler.py
   thumnew task

   starting task
   Traceback (most recent call last):
     File trunk/gluon/meta_scheduler.py, line 139, in module
       MetaScheduler().loop()
     File trunk/gluon/meta_scheduler.py, line 132, in loop
       self.report_task(task,self.async(task))
     File trunk/gluon/meta_scheduler.py, line 55, in async
       p.start()
     File C:\Python26\lib\multiprocessing\process.py, line 104, in start
       self._popen = Popen(self)
     File C:\Python26\lib\multiprocessing\forking.py, line 239, in
  __init__
       dump(process_obj, to_child, HIGHEST_PROTOCOL)
     File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump
       ForkingPickler(file, protocol).dump(obj)
     File C:\Python26\lib\pickle.py, line 224, in dump
       self.save(obj)
     File C:\Python26\lib\pickle.py, line 331, in save
       self.save_reduce(obj=obj, *rv)
     File C:\Python26\lib\pickle.py, line 419, in save_reduce
       save(state)
     File C:\Python26\lib\pickle.py, line 286, in save
       f(self, obj) # Call unbound method with explicit self
     File C:\Python26\lib\pickle.py, line 649, in save_dict
       self._batch_setitems(obj.iteritems())
     File C:\Python26\lib\pickle.py, line 681, in _batch_setitems
       save(v)
     File C:\Python26\lib\pickle.py, line 286, in save
       f(self, obj) # Call unbound method with explicit self
     File C:\Python26\lib\pickle.py, line 748, in save_global
       (obj, module, name))
   pickle.PicklingError: Can't pickle function executor at 0x0152AC30:
  it's
   not f
   ound as __main__.executor
   Traceback (most recent call last):
     File string, line 1, in module
     File C:\Python26\lib\multiprocessing\forking.py, line 342, in main
       self = load(from_parent)
     File C:\Python26\lib\pickle.py, line 1370, in load
       return Unpickler(file).load()
   t  File C:\Python26\lib\pickle.py, line 858, in load
   hum
       dispatch[key](self)
     File C:\Python26\lib\pickle.py, line 880, in load_eof
       raise EOFError
   EOFError
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum
   thum


[web2py] Re: mssql connect

2011-08-31 Thread patrick moon
I tried to run from the source but this is what I get.

Module use of python25.dll conflicts with this version of Python.

Is there a way around this?  Thanks

On Aug 31, 12:14 pm, Willoughby neil.erik...@gmail.com wrote:
 Also check to make sure it's loading the MSSQL database driver.
 You have to run from source, the binary doesn't have 
 it:http://www.web2py.com/book/default/chapter/06#Dependencies


[web2py] Re: mssql connect

2011-08-31 Thread Brian M
What version of python are you using?  Have you installed the matching 
pyodbc version from http://code.google.com/p/pyodbc/?

~Brian


[web2py] Re: testing scheduler in windows

2011-08-31 Thread Anthony
FYI, just tried it again, and seems to be working now (no traceback, and it 
cycles as expected).

Anthony

On Wednesday, August 31, 2011 9:59:15 PM UTC-4, Massimo Di Pierro wrote:

 Can you help me for the next 15 minutes? If so, let's take this 
 private and please email me. 

 On Aug 31, 8:50 pm, Brian Meredyk bmer...@gmail.com wrote: 
  no change :( 
  
  C:\Users\Brian\Documents\development\web2py\google hg repopython 
  trunk/gluon/me 
  ta_scheduler.py 
  thumnew task 
  
  starting task 
  Traceback (most recent call last): 
File trunk/gluon/meta_scheduler.py, line 139, in module 
  MetaScheduler().loop() 
File trunk/gluon/meta_scheduler.py, line 132, in loop 
  self.report_task(task,self.async(task)) 
File trunk/gluon/meta_scheduler.py, line 55, in async 
  p.start() 
File C:\Python26\lib\multiprocessing\process.py, line 104, in start 
  self._popen = Popen(self) 
File C:\Python26\lib\multiprocessing\forking.py, line 239, in 
 __init__ 
  dump(process_obj, to_child, HIGHEST_PROTOCOL) 
File C:\Python26\lib\multiprocessing\forking.py, line 162, in dump 
  ForkingPickler(file, protocol).dump(obj) 
File C:\Python26\lib\pickle.py, line 224, in dump 
  self.save(obj) 
File C:\Python26\lib\pickle.py, line 331, in save 
  self.save_reduce(obj=obj, *rv) 
File C:\Python26\lib\pickle.py, line 419, in save_reduce 
  save(state) 
File C:\Python26\lib\pickle.py, line 286, in save 
  f(self, obj) # Call unbound method with explicit self 
File C:\Python26\lib\pickle.py, line 649, in save_dict 
  self._batch_setitems(obj.iteritems()) 
File C:\Python26\lib\pickle.py, line 681, in _batch_setitems 
  save(v) 
File C:\Python26\lib\pickle.py, line 286, in save 
  f(self, obj) # Call unbound method with explicit self 
File C:\Python26\lib\pickle.py, line 748, in save_global 
  (obj, module, name)) 
  pickle.PicklingError: Can't pickle function executor at 0x014BAC30: 
 it's 
  not f 
  ound as __main__.executor 
  Traceback (most recent call last): 
File string, line 1, in module 
File C:\Python26\lib\multiprocessing\forking.py, line 342, in main 
  self = load(from_parent) 
File C:\Python26\lib\pickle.py, line 1370, in load 
  thumreturn Unpickler(file).load() 
  
File C:\Python26\lib\pickle.py, line 858, in load 
  dispatch[key](self) 
File C:\Python26\lib\pickle.py, line 880, in load_eof 
  raise EOFError 
  EOFError 
  thum 
  thum 
  thum 
  thum 
  thum 
  thum 
  
  On Wed, Aug 31, 2011 at 8:41 PM, Massimo Di Pierro  
  
  
  
  
  
  
  
  massimo@gmail.com wrote: 
   one more test please... :-) 
  
   On Aug 31, 8:28 pm, Brian M bmer...@gmail.com wrote: 
OK, just pulled from trunk and trying with Python 2.6.4 on win7 - 
 still 
   no 
luck though the traceback seems slightly different now. 
  
C:\Users\Brian\Documents\development\web2py\google hg repopython 
trunk/gluon/me 
ta_scheduler.py 
thumnew task 
  
starting task 
Traceback (most recent call last): 
  File trunk/gluon/meta_scheduler.py, line 139, in module 
MetaScheduler().loop() 
  File trunk/gluon/meta_scheduler.py, line 132, in loop 
self.report_task(task,self.async(task)) 
  File trunk/gluon/meta_scheduler.py, line 55, in async 
p.start() 
  File C:\Python26\lib\multiprocessing\process.py, line 104, in 
 start 
self._popen = Popen(self) 
  File C:\Python26\lib\multiprocessing\forking.py, line 239, in 
   __init__ 
dump(process_obj, to_child, HIGHEST_PROTOCOL) 
  File C:\Python26\lib\multiprocessing\forking.py, line 162, in 
 dump 
ForkingPickler(file, protocol).dump(obj) 
  File C:\Python26\lib\pickle.py, line 224, in dump 
self.save(obj) 
  File C:\Python26\lib\pickle.py, line 331, in save 
self.save_reduce(obj=obj, *rv) 
  File C:\Python26\lib\pickle.py, line 419, in save_reduce 
save(state) 
  File C:\Python26\lib\pickle.py, line 286, in save 
f(self, obj) # Call unbound method with explicit self 
  File C:\Python26\lib\pickle.py, line 649, in save_dict 
self._batch_setitems(obj.iteritems()) 
  File C:\Python26\lib\pickle.py, line 681, in _batch_setitems 
save(v) 
  File C:\Python26\lib\pickle.py, line 286, in save 
f(self, obj) # Call unbound method with explicit self 
  File C:\Python26\lib\pickle.py, line 748, in save_global 
(obj, module, name)) 
pickle.PicklingError: Can't pickle function executor at 0x0152AC30: 

   it's 
not f 
ound as __main__.executor 
Traceback (most recent call last): 
  File string, line 1, in module 
  File C:\Python26\lib\multiprocessing\forking.py, line 342, in 
 main 
self = load(from_parent) 
  File C:\Python26\lib\pickle.py, line 1370, in load 
return Unpickler(file).load() 
t  File C:\Python26\lib\pickle.py, line 858, 

[web2py] Re: testing scheduler in windows

2011-08-31 Thread Brian M
Yes, Massimo got meta_scheduler.py working but fixing the actual scheduler 
is going to take more time  effort.  Unfortunately on Windows you can't 
just pass functions from the main process to the process that runs tasks 
like you can on Linux.  Massimo put a brief post over on the 
web2py-developers group 
https://groups.google.com/forum/?hl=en#!topic/web2py-developers/RsKCOjY87JA

~Brian


Re: [web2py] Re: Some powerTable questions

2011-08-31 Thread Roberto Perdomo
Bruno, please add #refreshLabel = 'Refresh' to you example of powergrid, or
the best solution: why not use T('label') as example
self.attributes['refreshLabel'] = T('Refresh') in  powergrid.py for
translate support?



2011/8/29 Bruno Rocha rochacbr...@gmail.com

 something like this:
 http://wijmo.com/Wijmo-Complete/samples/#tree|overview

 or may be this:
 http://wijmo.com/Wijmo-Complete/samples/#grid|grouping-and-aggregates

 (the column resizing you talk
 http://wijmo.com/Wijmo-Complete/samples/#grid|column-resizing)