Moved generate odt action code to avis classes

This commit is contained in:
Frédéric Péters 2010-07-15 16:20:09 +02:00
parent e7fbcedf7a
commit 3e576d64cf
3 changed files with 12 additions and 12 deletions

View File

@ -33,13 +33,6 @@ from config import *
class AvisOdt:
'''Base class for common methods of Avis'''
def canSetDefaultPage(self):
return False
def generateOdt(self, RESPONSE):
'''Generates the ODT version of this advice.'''
return self._generate(RESPONSE, 'odt')
def _generate(self, response, fileType):
'''Generates a document that represents this advice.
The document format is specified by p_fileType.'''

View File

@ -3836,7 +3836,7 @@ class AvisLegis(BaseContent, AvisOdt):
{'action': "string:$object_url/generateOdt",
'category': "document_actions",
'id': 'asOdt',
'name': 'Generer en ODT',
'name': u'Générer en ODT',
'permissions': ("View",),
'condition': 'python:1'
},
@ -3854,6 +3854,11 @@ class AvisLegis(BaseContent, AvisOdt):
'decret': "de "
}
security.declarePublic('generateOdt')
def generateOdt(self, RESPONSE):
'''Generates the ODT version of this advice.'''
return self._generate(RESPONSE, 'odt')
security.declarePublic('getResponses')
def getResponses(self):
"""Returns the predefined responses that are possible for each question.

View File

@ -804,22 +804,24 @@ class AvisSimplif(BaseContent, AvisOdt):
typeDescription = "AvisSimplif"
typeDescMsgId = 'description_edit_avis_simplif'
security.declarePublic('generateOdt')
actions = (
{'action': "string:$object_url/generateOdt",
'category': "document_actions",
'id': 'asOdt',
'name': 'Generer en ODT',
'name': u'Générer en ODT',
'permissions': ("View",),
'condition': 'python:1'
},
)
_at_rename_after_creation = True
schema = AvisSimplif_schema
security.declarePublic('generateOdt')
def generateOdt(self, RESPONSE):
'''Generates the ODT version of this advice.'''
return self._generate(RESPONSE, 'odt')
security.declarePublic('getResponses')
def getResponses(self):
"""Returns the predefined responses that are possible for each question.