Re: Re: Maybe problems with Metakit 2.4.9.3

Yasushi Iwata <[email protected]>
Newsgroups gmane.comp.db.metakit
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.