Exemple #1
0
 def close_for_comments(self):
     """
     Disable(close) comments.
     """
     NyContainer.close_for_comments(self)
     for photo in self.getObjects():
         photo.close_for_comments()
Exemple #2
0
 def close_for_comments(self):
     """
     Disable(close) comments.
     """
     NyContainer.close_for_comments(self)
     for photo in self.getObjects():
         photo.close_for_comments()
Exemple #3
0
 def open_for_comments(self):
     """
     Enable(open) comments.
     """
     NyContainer.open_for_comments(self)
     for photo in self.getObjects():
         photo.open_for_comments()
Exemple #4
0
 def open_for_comments(self):
     """
     Enable(open) comments.
     """
     NyContainer.open_for_comments(self)
     for photo in self.getObjects():
         photo.open_for_comments()
 def __init__(self, id, contributor):
     self.id = id
     #self.approved = approved
     #self.approved_by = approved_by
     NyContainer.__init__(self)
     NyContentData.__init__(self)
     #self.save_properties(title, lang, **kwargs)
     self.contributor = contributor
 def __init__(self, id, contributor):
     self.id = id
     # self.approved = approved
     # self.approved_by = approved_by
     NyContainer.__init__(self)
     NyContentData.__init__(self)
     # self.save_properties(title, lang, **kwargs)
     self.contributor = contributor
Exemple #7
0
    def manage_addFile(self, id, file="", **kwargs):
        # if self.is_ext:
        #     return manage_addExtFile(self, id=id, file=file)
        if self.is_blobfile:
            if isinstance(file, basestring):
                if not bool(id):
                    raise ValueError, "Please specify id of file passed as string"

                f = StringIO()
                f.write(file)
                f.seek(0)
                f.filename = id
                file = f

            if not bool(id):  # TODO: make sure of proper id
                id = file.filename

            blobfile = make_blobfile(file)
            self._setObject(id, blobfile, set_owner=0)
            blobfile.id = id
            return blobfile.getId()
        else:
            return NyContainer.manage_addFile(self, id, file)
    def manage_addFile(self, id, file="", **kwargs):
        # if self.is_ext:
        #     return manage_addExtFile(self, id=id, file=file)
        if self.is_blobfile:
            if isinstance(file, basestring):
                if not bool(id):
                    raise ValueError, "Please specify id of file passed as string"

                f = StringIO()
                f.write(file)
                f.seek(0)
                f.filename = id
                file = f

            if not bool(id):    # TODO: make sure of proper id
                id = file.filename

            blobfile = make_blobfile(file)
            self._setObject(id, blobfile, set_owner=0)
            blobfile.id = id
            return blobfile.getId()
        else:
            return NyContainer.manage_addFile(self, id, file)
Exemple #9
0
 def manage_addFile(self, id, file="", **kwargs):
     if self.is_ext:
         return manage_addExtFile(self, id=id, file=file)
     return NyContainer.manage_addFile(self, id, file)
Exemple #10
0
 def __init__(self):
     NyContainer.__init__(self)
Exemple #11
0
 def __init__(self, id, contributor):
     self.id = id
     self.contributor = contributor
     self.displays = DEFAULT_DISPLAYS.copy()
     NyContainer.__init__(self)
     NyContentData.__init__(self)
Exemple #12
0
 def __init__(self):
     NyContainer.__init__(self)
Exemple #13
0
 def __init__(self, id, contributor):
     self.id = id
     self.contributor = contributor
     self.displays = DEFAULT_DISPLAYS.copy()
     NyContainer.__init__(self)
     NyContentData.__init__(self)
 def manage_addFile(self, id, file="", **kwargs):
     if self.is_ext:
         return manage_addExtFile(self, id=id, file=file)
     return NyContainer.manage_addFile(self, id, file)