Extends the model with the given list of documents.
(self, documents)
| 915 | list.append(self.documents, document) |
| 916 | |
| 917 | def extend(self, documents): |
| 918 | """ Extends the model with the given list of documents. |
| 919 | """ |
| 920 | for document in documents: |
| 921 | if not isinstance(document, Document): |
| 922 | raise TypeError, "Model.extend() expects a list of Documents." |
| 923 | document._model = self |
| 924 | if document.name is not None: |
| 925 | self._index[document.name] = document |
| 926 | if self._weight != TF: |
| 927 | self._update() |
| 928 | list.extend(self.documents, documents) |
| 929 | |
| 930 | def remove(self, document): |
| 931 | """ Removes the given Document from the model, and sets Document.model=None. |