Yasushi Iwata wrote:

> Hi,
>
> I removed spaces from getas statement. But following code still
> causes segmentation fault with 2.4.9.3. Am I doing something wrong?
>
>
> --
>
> import metakit
>
> 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, 30): print 'Appending %d...' % i
> comments.append({ 'user': '00000001', 'paragraph': 'P%d' % i,
> 'link': 'http://foo.com/', 'notes': metakit.view() }) print '%d OK'
> % i db.commit()


I might have made the change without telling you, but you don't need
the "metakit.view()" entry for the 'notes', I'm not sure why this
crashes, but by default the notes view will be created empty.

The spaces were certainly wrong, but they probably shouldn't have
caused a crash, so maybe the metakit.view() in the append statement is
broken.  To be safe you could use 'notes': None which will insert the
default object, in this case the view.

To access the view you will need to find the right row, such as

index = comments.find(user='00000001', paragraph='P1')
if index != -1:
  notes = comments[index].notes
  notes.append(...)

Brian

> _____________________________________________ Metakit mailing list
> -  [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit


_____________________________________________ Metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit

Reply via email to