Hi Massimo, It works now :-)
Regards, Marin On Wed, Aug 17, 2011 at 8:50 PM, Massimo Di Pierro < [email protected]> wrote: > The reason for the change was to avoid records populated with the zero > option (''). > I think I fixed the problem, please check it. > > On Aug 17, 1:44 pm, Marin Pranjić <[email protected]> wrote: > > Hi, > > > > i have a code that works on latest stable, but raises an exception in > > trunk version. > > > > File "/srv/web2py/gluon/contrib/populate.py", line 97, in populate > > record[fieldname] = options[random.randint(0,len(options)-1)][0] > > File "/usr/lib/python2.7/random.py", line 241, in randint > > return self.randrange(a, b+1) > > File "/usr/lib/python2.7/random.py", line 217, in randrange > > raise ValueError, "empty range for randrange() (%d,%d, %d)" % > > (istart, istop, width) > > ValueError: empty range for randrange() (0,0, 0) > > > > I'm still trying to reproduce this and find what causes this > > exception. It must be something related to latest changes because it > > works in stable. > > Line 96 has changed so someone must know why and where is the bug :-) > > 96: options=field.requires.options(zero=False) > > > > Something related to Field(... requires=... ) ? > > I will reply when I reproduce on minimalist test app. > > > > Marin >

