コード例 #1
0
ファイル: fields.py プロジェクト: jerem/django-rcsfield
    def post_save(self, instance=None, **kwargs):
        """
        create a file and add to the repository, if not already existing
        called via post_save signal

        """
        data = getattr(instance, self.attname)
        key = self.get_key(instance)
        backend.commit(key, data.encode('utf-8'))
コード例 #2
0
    def post_save(self, instance=None, **kwargs):
        """
        create a file and add to the repository, if not already existing
        called via post_save signal

        """
        data = getattr(instance, self.attname)
        key = self.get_key(instance)
        backend.commit(key, data.encode('utf-8'))
コード例 #3
0
    def post_save(self, instance=None, **kwargs):
        """
        create a file and add to the repository, if not already existing
        called via post_save signal

        """
        data = getattr(instance, self.attname)
        key = self.rcskey_format % (instance._meta.app_label, instance.__class__.__name__, self.attname, instance.id)
        try:
            backend.commit(key, data.encode("utf-8"))
        except:
            raise