In our work we migrate from version of Web2py from 1.96.4 to 1.99.7, but we 
have the following problem: SQLFORM not print the ID values ​​less and 
equal than zero, the referenced table (ex. table "a"). any security reason for 
this change?

# controller: debug.py
def index(): 
  db.define_table('a',
    Field('namea'),
    format='%(namea)s'
  )  
  db.define_table('b',
    Field('nameb'),
    Field('a_id',db.a)
  )
  form = SQLFORM(db.b)
  return dict(form=form)

#table "a" contains
ALTER SEQUENCE a_id_seq   MINVALUE 0; # we need zero in the table, and we 
need to show in the form. its run in w2p 1.96, but not in 1.99
INSERT INTO a (id, namea) VALUES (0, 'a_0');
INSERT INTO a (id, namea) VALUES (1, 'a_1');
INSERT INTO a (id, namea) VALUES (2, 'a_2');
INSERT INTO a (id, namea) VALUES (3, 'a_3');
INSERT INTO a (id, namea) VALUES (4, 'a_4');
INSERT INTO a (id, namea) VALUES (5, 'a_5');

#The SELECT VIEW no print a_0 option, and if torce it, the validator print 
the error VALUE NO IN DATABASE

select id="b_a_id" class="generic-widget" name="a_id">
<option value=""></option>
<option value="1">a_1</option>
<option value="2">a_2</option>
<option value="3">a_3</option>
<option value="4">a_4</option>
<option value="5">a_5</option>
</select>

Reply via email to