def factory_object(self, index, doc_type, data=None, id=None):
data = data or {}<EOL>obj = self.model()<EOL>obj._meta.index = index<EOL>obj._meta.type = doc_type<EOL>obj._meta.connection = self<EOL>if id:<EOL><INDENT>obj._meta.id = id<EOL><DEDENT>if data:<EOL><INDENT>obj.update(data)<EOL><DEDENT>return obj<EOL>
Create a stub object to be manipulated