The problem with _extra is now fixed in trunk and the fix is compatible with the temporary fix I suggested before (will work with or without it). I also added new tests and they pass:
>>> mynumber=db.define_table('mynumber',SQLField('x','integer')) >>> db(mynumber.id>0).delete() >>> for i in range(10): tmp=mynumber.insert(x=i) >>> db(mynumber.id>0).select(mynumber.x.sum())[0]._extra [mynumber.x.sum()] 45 >>> db(mynumber.x+2==5).select(mynumber.x+2)[0]._extra[mynumber.x +2] 5 Massimo On Nov 18, 9:24 am, mdipierro <[EMAIL PROTECTED]> wrote: > This causes your second problem: > > default=db.t2_person.id > > a default must be a value, cannot be a field object. > > Massimo > > On Nov 18, 9:03 am, pmate <[EMAIL PROTECTED]> wrote: > > > Thanks Massimo, > > _extra[str(.... > > > solved my first problem. > > For the second one, here is what you asked: > > > db.define_table('movimenti', > > SQLField('data','date',requires=IS_DATE('%d/%m/%Y'),default=now), > > SQLField('t2_person_id',default=db.t2_person.id), > > SQLField('ente_id',db.enti), > > SQLField('tipo',requires=IS_IN_SET > > (['carico','scarico']),default=''), > > SQLField('completato','boolean',default=False)) > > > Thanks a lot for your help > > > Paolo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---