def initial_data(self, doc): if callable(doc) and IDocument.implementedBy(doc): doc = doc() doc = IDocument(doc) if doc.doc_id is None: raise ValueError("Initial documents should have doc_id fixed (None)") self._initial_data.register(doc, application=self) return doc