Axiom "startswith" problem

Robert Gravina <[email protected]> Mon, 18 Sep 2006 07:14:06 +0900
Newsgroups gmane.comp.python.quotient.dev
Message-ID <[email protected]>
Can anyone explain why startswith complains that it's argument is not  
unicode here? I get the same problem with endswith, but ==/!=/like/ 
notLike work OK.

Running this script gives output like this:

Fred Smith
Fred Smith
Traceback (most recent call last):
.....
axiom.attributes.ConstraintError: attribute [Person.name = text()]  
must be (unicode string without NULL bytes); not 'str'

--------------
from axiom.store import Store
from axiom.item import Item
from axiom.attributes import text

class Person(Item):
     typeName = "Person"
     name = text()

store = Store()
person = Person(store=store, name=u"Fred Smith")

for person in store.query(Person, Person.name == u"Fred Smith"):
     print person.name

for person in store.query(Person, Person.name.like(u"Fred Smith")):
     print person.name

for person in store.query(Person, Person.name.startswith(u"Fred")):
     print person.name
--------------

Robert