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