コード例 #1
0
    def save(self):
        from the_tale.collections.storage import collections_storage

        if id(self) != id(collections_storage[self.id]):
            raise exceptions.SaveNotRegisteredCollectionError(collection=self)

        super(CollectionPrototype, self).save()

        collections_storage.update_version()
コード例 #2
0
ファイル: prototypes.py プロジェクト: Alkalit/the-tale
    def save(self):
        from the_tale.collections.storage import collections_storage

        if id(self) != id(collections_storage[self.id]):
            raise exceptions.SaveNotRegisteredCollectionError(collection=self)

        super(CollectionPrototype, self).save()

        collections_storage.update_version()
コード例 #3
0
    def create(cls, caption, description, approved=False):
        from the_tale.collections.storage import collections_storage

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

        prototype = cls(model=model)

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

        return prototype
コード例 #4
0
ファイル: prototypes.py プロジェクト: Alkalit/the-tale
    def create(cls, caption, description, approved=False):
        from the_tale.collections.storage import collections_storage

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

        prototype = cls(model=model)

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

        return prototype