Example #1
0
 def close_for_comments(self):
     """
     Disable(close) comments.
     """
     NyContainer.close_for_comments(self)
     for photo in self.getObjects():
         photo.close_for_comments()
Example #2
0
 def close_for_comments(self):
     """
     Disable(close) comments.
     """
     NyContainer.close_for_comments(self)
     for photo in self.getObjects():
         photo.close_for_comments()
Example #3
0
 def open_for_comments(self):
     """
     Enable(open) comments.
     """
     NyContainer.open_for_comments(self)
     for photo in self.getObjects():
         photo.open_for_comments()
Example #4
0
 def open_for_comments(self):
     """
     Enable(open) comments.
     """
     NyContainer.open_for_comments(self)
     for photo in self.getObjects():
         photo.open_for_comments()
Example #5
0
 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
Example #6
0
 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
Example #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)
Example #8
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)
Example #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)
Example #10
0
 def __init__(self):
     NyContainer.__init__(self)
Example #11
0
 def __init__(self, id, contributor):
     self.id = id
     self.contributor = contributor
     self.displays = DEFAULT_DISPLAYS.copy()
     NyContainer.__init__(self)
     NyContentData.__init__(self)
Example #12
0
 def __init__(self):
     NyContainer.__init__(self)
Example #13
0
 def __init__(self, id, contributor):
     self.id = id
     self.contributor = contributor
     self.displays = DEFAULT_DISPLAYS.copy()
     NyContainer.__init__(self)
     NyContentData.__init__(self)
Example #14
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)