Truncated model:

db.define_table('akb_doccenter',
                Field('doc_nr', type='string', length=50,
                      requires=IS_NOT_IN_DB(db, 'doccenter.doc_nr')),
                Field('location'))

db.akb_doccenter.doc_nr.widget =SQLFORM.widgets.autocomplete(
    request, db.akb_doccenter.doc_nr, limitby=(0,20),min_length=2)


I use an autocomplete-widget to help the user to enter a unique doc_nr.

It works to a certain extend in the sense that it shows the doc_nr's in the
database except for those recently added.  The database was prepopulated
with data from an older version.  All the records entered after that will
not show up in the list shown by autocomplete.  But if you search for it
they are there amongst the other data.

At first I thought creating an index on doc_nr would change this behaviour
but it didn't.

I have appended the screenshot.  Compare that with the result of the query:

select doc_nr from akb_doccenter where doc_nr like 'wood5%'

"wood591"
"wood5224"
"wood5225"


Any idea how to fix this?

Regards
Johann



-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
                                                    2 Pet. 1:2b,3a

<<attachment: Screenshot - 24052011 - 11:47:30.png>>

Reply via email to