def __call__ ( self , * args , * * kwargs ) : kwargs [ "mongokat_collection" ] = self return self . document_class ( * args , * * kwargs )
dynamically create documents python mongoegine
Instanciates a new * Document * from this collection
def __call__(self, *args, **kwargs):
        """ Instanciates a new *Document* from this collection """
        kwargs["mongokat_collection"] = self
        return self.document_class(*args, **kwargs)