Beispiel #1
0
    def getParent(self,view):
        if self.parentName:
            return parcel_for_module(self.parentName,view)
        else:
            root = view.findPath('parcels')
            if root is None:
                from application.Parcel import Parcel
                # Make sure the Parcel kind exists (which may cause //parcels
                # to get created through a recursive re-entry of this function)
                itemFor(Parcel, view)

                # Create //parcels *only* if it still doesn't exist yet
                root = view.findPath('parcels')
                if root is None:
                    root = Parcel('parcels',view)
                    declareTemplate(root)

            return root