Several bugfixes while handling abstract classes (appy.gen) and added a first code chunk used while installing a gen-application for Plone 3.

This commit is contained in:
Gaetan Delannay 2010-04-26 18:19:34 +02:00
parent ca7b688c00
commit 46cda3f755
7 changed files with 49 additions and 3 deletions

View file

@ -333,13 +333,14 @@ class ToolMixin(AbstractMixin):
'''Gets the Appy Python class that is related to p_contentType.'''
# Retrieve first the Archetypes class corresponding to p_ContentType
portalType = self.portal_types.get(contentType)
if not portalType: return None
atClassName = portalType.getProperty('content_meta_type')
appName = self.getProductConfig().PROJECTNAME
exec 'from Products.%s.%s import %s as atClass' % \
(appName, atClassName, atClassName)
# Get then the Appy Python class
return atClass.wrapperClass.__bases__[-1]
def getCreateMeans(self, contentTypeOrAppyClass):
'''Gets the different ways objects of p_contentTypeOrAppyClass (which
can be a Plone content type or a Appy class) can be created