orator
orator copied to clipboard
AttributeError: set_timestamps_on_attach
Calling update_existing_pivot on belongs_to_many relation fails with an attribute error:
File "lib/python3.6/site-packages/orator/orm/relations/belongs_to_many.py", line 632, in update_existing_pivot
attributes = self.set_timestamps_on_attach(attributes, True)
File "lib/python3.6/site-packages/orator/orm/relations/relation.py", line 242, in __getattr__
return self.__dynamic(item)
File "lib/python3.6/site-packages/orator/orm/relations/relation.py", line 226, in __dynamic
attribute = getattr(self._query, method)
File "lib/python3.6/site-packages/orator/orm/builder.py", line 1173, in __getattr__
return self.__dynamic(item)
File "lib/python3.6/site-packages/orator/orm/builder.py", line 1152, in __dynamic
attribute = getattr(self._query, method)
File "lib/python3.6/site-packages/orator/query/builder.py", line 1678, in __getattr__
raise AttributeError(item)
AttributeError: set_timestamps_on_attach
Also, it seems that set_timestamps_on_attach is not implemented anywhere in the project - I just did a quick search in the Github repo.
This is an old one, but it still happens. Looks like the error is in this line.
It should be _set_timestamps_on_attach (with the underscore).