I am using SQLAlchemy with PostgreSQL and Python3. Is there a in-build-function to duplicate the instance of a data object (except the primary key)?
Somebody suggested me this self-build function but I would like to use the SQLAlchemy-way if there is one. >From <http://www.python-forum.de/viewtopic.php?p=273016#p273016> def duplicate(self): arguments = dict() for name, column in self.__mapper__.columns.items(): if not (column.primary_key or column.unique): arguments[name] = getattr(self, name) return self.__class__(**arguments) -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.