Example #1
0
    def save(self):
        from the_tale.collections.storage import kits_storage

        if id(self) != id(kits_storage[self.id]):
            raise exceptions.SaveNotRegisteredKitError(kit=self)

        super(KitPrototype, self).save()

        kits_storage.update_version()
Example #2
0
    def save(self):
        from the_tale.collections.storage import kits_storage

        if id(self) != id(kits_storage[self.id]):
            raise exceptions.SaveNotRegisteredKitError(kit=self)

        super(KitPrototype, self).save()

        kits_storage.update_version()
Example #3
0
    def create(cls, collection, caption, description, approved=False):
        from the_tale.collections.storage import kits_storage

        model = cls._model_class.objects.create(collection=collection._model,
                                                caption=caption,
                                                description=description,
                                                approved=approved)

        prototype = cls(model=model)

        kits_storage.add_item(prototype.id, prototype)
        kits_storage.update_version()

        return prototype
Example #4
0
    def create(cls, collection, caption, description, approved=False):
        from the_tale.collections.storage import kits_storage

        model = cls._model_class.objects.create(collection=collection._model,
                                                caption=caption,
                                                description=description,
                                                approved=approved)

        prototype = cls(model=model)

        kits_storage.add_item(prototype.id, prototype)
        kits_storage.update_version()

        return prototype