Wednesday, December 11, 2013

AttributeError: 'dict' object has no attribute '_set_parent_with_dispatch' - SQLalchemy



The documentation says: "Keyword arguments can be specified by specifying the last argument as a dictionary"

So you will need to change this:
__table_args__ = (
{'sqlite_autoincrement': True},
            UniqueConstraint('filename', 'path')
            )

to this:
__table_args__ = (
            UniqueConstraint('filename', 'path'),
            {'sqlite_autoincrement': True}

            )

3 comments: