Hi,

I found another problem. Following code dose not work as expected.

--

db = metakit.storage('foo.dat', 1)

comments = db.getas(
    'comments[user:S,paragraph:S,link:S,notes[name:S,email:S,url:S,comment:S,date:S]]'
    ).ordered(2)

for i in range(1, 3):
    print 'Appending %d...' % i
    comments.append({
        'user': '00000001',
        'paragraph': 'P%d' % i,
        'link': 'http://foo.com/',
        })
    print '%d OK' % i
    db.commit()

for i in range(1, 3):
    idx = comments.find(user='00000001', paragraph='P%d' % i)

    if idx == -1:
        print 'P%d not found' % i
    else:
        print comments[idx].paragraph, 'found'

--

  $ python2.3 foo.py
  Appending 1...
  1 OK
  Appending 2...
  2 OK
  P1 not found
  P2 not found

But if you remove ordered(2) from getas(), it works as expected. I
also removed ordered(2) from example code that I posted yesterday, it
worked fine. There must be something wrong with ordered().
_____________________________________________
Metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to