Hi, Michael Thanks so much for your feedback. You were right on the button (second scenario): I was pretty sure I was passing a scalar to the list's append() method but was, in fact, passing it another list.
Help greatly appreciated, really. Regards On Nov 6, 2:58 pm, Michael Bayer <[email protected]> wrote: > On Nov 6, 2010, at 1:32 AM, pianoman wrote: > > > > > Hi > > > I feel I have exhausted all the usual options in finding a solution > > for this problem. > > > I'm using Python 2.5.5, SQLAlchemy 0.4.6, and Elixir 0.5.2. I'm really > > not sure how much code I should include for this to make any sense to > > others. > > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > The actual traceback is as follows: > > > ERROR: An unexpected error occurred while tokenizing input > > The following traceback may be corrupted or invalid > > The error message is: ('EOF in multi-line statement', (30, 0)) > > --------------------------------------------------------------------------- > > AttributeError Traceback (most recent call > > last) > > > C:\Users\User\My iFolder\My Development\Python\TurboGears\DMS-Test > > \dmstest\model.py in <module>() > > ----> 1 > > 2 > > 3 > > 4 > > 5 > > > C:\Users\User\My iFolder\My Development\Python\TurboGears\DMS-Test > > \dmstest\model.py in register(cls, person, ref, versio > > n, file_name, reg_date, write) > > 564 names.append(record['author-%s' % a]) > > 565 else: > > --> 566 doc.authors.append(author) > > 567 a += 1 > > 568 > > > c:\VirtualEnvs\tg1env\lib\site-packages\sqlalchemy-0.4.6-py2.5.egg > > \sqlalchemy\orm\collections.pyc in append(self, item, > > _sa_initiator) > > 919 if executor: > > 920 > > executor.attr.fire_append_event(executor.owner_state, > > --> 921 item, > > _sa_initiator) > > 922 fn(self, item) > > 923 _tidy(append) > > > c:\VirtualEnvs\tg1env\lib\site-packages\sqlalchemy-0.4.6-py2.5.egg > > \sqlalchemy\orm\attributes.pyc in fire_append_event(se > > lf, state, value, initiator) > > 509 > > 510 if self.trackparent and value is not None: > > --> 511 self.sethasparent(value._state, True) > > 512 instance = state.obj() > > 513 for ext in self.extensions: > > > AttributeError: 'list' object has no attribute '_state' > > the kind of thing that would do this is: > > someobject.some_scalar_attribute = [<some list>] > > or: > > someobject.some_related_list.append([<some list>]) > > So your stack trace above would suggest that "author" is a Python list when > it should be a scalar element. Using pdb would help you to drop into a > console at the point the error occurs in which you can inspect "author" as > well as travel up the stack to see where it came from. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
