コード例 #1
0
ファイル: Bust.py プロジェクト: peterbe/zope_products
def manage_addBust(dispatcher, id, bigphoto, littleimage, title, 
                   description=u'', REQUEST=None,
                   redirect_to=None):
    """ create instance """
    
    if not id:
        id = title.replace('&',' o ').strip().replace('  ',' ')
        id = id.replace(' ','-')
        id = internationalizeID(id)
    
    dest = dispatcher.Destination()
        
    instance = Bust(id, title, description=description)
    dest._setObject(id, instance)
    object = dest._getOb(id)
    #object.DeployStandards()
    object.uploadPhoto(bigphoto)
    if getattr(littleimage, 'filename', None):
        object.uploadThumbnail(littleimage)
    else:
        object.convertPhotoToThumbnail()
    
    if REQUEST is not None:
        if redirect_to:
            REQUEST.RESPONSE.redirect(redirect_to)
        else:
            REQUEST.RESPONSE.redirect(REQUEST.URL1+'/BustManagement')
コード例 #2
0
ファイル: Guestbook.py プロジェクト: peterbe/zope_products
def manage_addGuestbook(dispatcher, id, title, REQUEST=None, redirect_to=None):
    """ create instance """
    if not id:
        id = title.replace("&", " o ").strip().replace("  ", " ")
        id = id.replace(" ", "-")
        id = internationalizeID(id)

    title = unicodify(title)

    dest = dispatcher.Destination()

    instance = Guestbook(id, title)
    dest._setObject(id, instance)
    object = dest._getOb(id)

    if REQUEST is not None:
        if redirect_to:
            REQUEST.RESPONSE.redirect(redirect_to)
        else:
            REQUEST.RESPONSE.redirect(REQUEST.URL1 + "/manage_workspace")
コード例 #3
0
ファイル: Blogs.py プロジェクト: peterbe/zope_products
def manage_addBlogContainer(dispatcher, id, title=u'', REQUEST=None):
    """ create instance """
    
    dest = dispatcher.Destination()
    
    id = id.strip()
    title = unicodify(title.strip())
    if title and not id:
        id = internationalizeID(title.replace(' ','-'))
        
    instance = BlogContainer(id, title)
    dest._setObject(id, instance)
    object = dest._getOb(id)
    
    if REQUEST is not None:
        if REQUEST.get('goto_after'):
            url = REQUEST.get('goto_after')
        else:
            url = REQUEST.URL1+'/manage_workspace'
        REQUEST.RESPONSE.redirect(url)
コード例 #4
0
ファイル: News.py プロジェクト: peterbe/zope_products
def manage_addNewsContainer(dispatcher, id, title='', REQUEST=None):
    """ create instance """
    
    dest = dispatcher.Destination()
    
    if not id and title:
        id = internationalizeID(title)
        id = id.replace(' ','-')
        
    title = unicodify(title)
        
    instance = NewsContainer(id, title)
    dest._setObject(id, instance)
    object = dest._getOb(id)
    #object.DeployStandards()
    
    if REQUEST is not None:
        if REQUEST.get('goto_after'):
            url = REQUEST.get('goto_after')
        else:
            url = REQUEST.URL1+'/manage_workspace'
        REQUEST.RESPONSE.redirect(url)
    else:
        return object
コード例 #5
0
ファイル: Files.py プロジェクト: peterbe/zope_products
 def searchable_text_ascii(self):
     """ return the value of searchable_text() ASCII encoded """
     return internationalizeID(self.searchable_text())
コード例 #6
0
ファイル: Files.py プロジェクト: peterbe/zope_products
 def getTitle_ascii(self):
     """ return getTitle() ascii encoded """
     return internationalizeID(self.getTitle())
コード例 #7
0
ファイル: BaseContent.py プロジェクト: peterbe/zope_products
 def getTitle_ascii(self):
     """
     Return the value of getTitle() ASCII encoded
     """
     return internationalizeID(self.getTitle())