예제 #1
0
파일: models.py 프로젝트: mariusae/ddb
    def save(self, force_insert=False, force_update=False):
        if self.pk:
            raise self.ImmutableError, (
                '%s objects are immutable once created' % self.__class__.__name__)

        super(DocIndexMapping, self).save(
            force_insert=force_insert, force_update=force_update)

        # Now, index existing fields.
        cls = self.doc_type.content_type.model_class()

        for obj in cls.objects.dtype(**{self.dfield: self.doc_type}):
            self.maybe_index_doc(obj, new_mapping=True)

        # Finally make sure we get the right set of hooks after
        # creating the mapping.
        signals.maybe_connect(cls)
예제 #2
0
파일: __init__.py 프로젝트: mariusae/ddb
def class_prepared_handler(sender, **kwargs):
    maybe_connect(sender)