If I have this model:

db.define_table('test',
    Field('name', writable=False),
    Field('refers_to', 'reference test'))

And this controller function:

def create():
    db.test.name.default=request.args(0)
    form = crud.create(db.test, next = URL('index'))
    return dict(form=form)

And go to URL .../create/xyzzy, I get the expected form but when I
submit I get a ticket with this exception:

Exception: <type 'exceptions.ValueError'>(invalid literal for int()
with base 10: '')

referring to this code:

 if field.type == 'integer':
                if fields[fieldname] != None:
                    fields[fieldname] = int(fields[fieldname])
            elif str(field.type).startswith('reference'):
                if fields[fieldname] != None and
isinstance(self.table,Table) and not keyed:
                    fields[fieldname] = int(fields[fieldname])

            elif field.type == 'double':
                if fields[fieldname] != None:
                    fields[fieldname] = float(fields[fieldname])

What dumb thing did I do?

Reply via email to