Am 02.07.2010 um 14:37 schrieb Andrea Crotti:

I'm using elixir and I get some errors in trying to actually add data
to my database.

If I only add a new record

       DBSession.add(person)

after configuring __init__.py with

maker = sessionmaker(autoflush=True, autocommit=True,
                    extension=ZopeTransactionExtension())

But the dictionary is actually passed correctly
Error - <type 'exceptions.AttributeError'>: 'NoneType' object has no
attribute '_iterate_parents'

{'name': u'sldkfjsdlk'}

And this is the root.py

   @validate(create_person_form) #, error_handler=new_person)
   @expose()
   def create_person(self, **kw):
       """ create a new entry, store it into the DB and exit """
       print kw
       # FIXME: the form values are in italian now!!
       person = Person(name=kw[u'name']) # pass directly the
dictionary with the values inserted
       DBSession.add(person)
       flash(l_("Record created correctly"))
       redirect("/")

What is this None referring to I don't understand...?

We neither, because you don't give the full traceback.

What I'm wondering though is why you add the entity at all, at least for us, that's done implicitly in elixir.

Diez

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to