def save(self, commit=True): """Save the record.""" db = object_session(self) db.add(self) if commit: db.commit() return self