Created
          March 28, 2014 08:48 
        
      - 
      
- 
        Save zopyx/9828198 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def linked_object_obj(self, obj): | |
| print obj | |
| try: | |
| o = obj.getObject() | |
| except Exception: | |
| o = None | |
| return o | |
| try: | |
| object_path = obj.getObject().getPhysicalPath() | |
| except AttributeError: | |
| object_path = '/' | |
| if object_path is None or len(object_path)==0: | |
| return None | |
| if object_path[0]=='/': | |
| object_path = object_path[1:] | |
| return self.portal.restrictedTraverse(object_path, default=None) | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment