parameters: (self, display=None, functions=[], owner=None, title=None)
return_statement: return self
docstring: Given a scoredisplay and a list of functions, this method
          will copy the display and assign the copy to the new owner
  
          Parameters:
              display -- a ScoreDisplay to copy - the current
                 Demographics display
              functions -- a list of ScoreFunctions or the primary
                  keys of ScoreFunctions to replace in the display's
                  first "district" ScorePanel
              owner -- the owner of the new ScoreDisplay - only set if we're not copying self
              title -- the title of the new scorefunction - only set if we're not copying self
  
          Returns:
              The new ScoreDisplay
docstring_summary: Given a scoredisplay and a list of functions, this method
          will copy the display and assign the copy to the new owner
docstring_tokens: Given a scoredisplay and a list of functions this method will copy the display and assign the copy to the new owner
function: def copy_from(self, display=None, functions=[], owner=None, title=None):
          """
          Given a scoredisplay and a list of functions, this method
          will copy the display and assign the copy to the new owner
  
          Parameters:
              display -- a ScoreDisplay to copy - the current
                 Demographics display
              functions -- a list of ScoreFunctions or the primary
                  keys of ScoreFunctions to replace in the display's
                  first "district" ScorePanel
              owner -- the owner of the new ScoreDisplay - only set if we're not copying self
              title -- the title of the new scorefunction - only set if we're not copying self
  
          Returns:
              The new ScoreDisplay
          """
  
          if display == None:
              return
  
          if self != display:
              self = copy(display)
              self.id = None
              self.name = ''
  
              self.owner = owner if owner != None else display.owner
  
              # We can't have duplicate titles per owner so append "copy" if we must
              if self.owner == display.owner:
                  self.title = title if not title is None else "%s copy" % display.__unicode__(
                  )
              else:
                  self.title = title if not title is None else display.__unicode__(
                  )
  
              self.save()
              self.scorepanel_set = display.scorepanel_set.all()
  
          else:
              self = display
  
          try:
              public_demo = self.scorepanel_set.get(type='district')
              if self != display:
                  self.scorepanel_set.remove(public_demo)
                  demo_panel = copy(public_demo)
                  demo_panel.id = None
                  demo_panel.name = '%(display_title)s Demographics' % {
                      'display_title': self.title
                  }
                  demo_panel.save()
                  self.scorepanel_set.add(demo_panel)
              else:
                  demo_panel = public_demo
  
              demo_panel.score_functions.clear()
              if len(functions) == 0:
                  return self
              for function in functions:
                  if isinstance(function, types.IntType):
                      function = ScoreFunction.objects.get(pk=function)
                  if isinstance(function, types.StringTypes):
                      function = ScoreFunction.objects.get(pk=int(function))
                  if type(function) == ScoreFunction:
                      demo_panel.score_functions.add(function)
              demo_panel.save()
              self.scorepanel_set.add(demo_panel)
              self.save()
          except Exception, ex:
              logger.info('Failed to copy ScoreDisplay %s to %s',
                          display.__unicode__(), self.__unicode__())
              logger.debug('Reason: %s', ex)
  
          return self
function_tokens: def copy_from ( self , display = None , functions = [ ] , owner = None , title = None ) : if display == None : return if self != display : self = copy ( display ) self . id = None self . name = '' self . owner = owner if owner != None else display . owner # We can't have duplicate titles per owner so append "copy" if we must if self . owner == display . owner : self . title = title if not title is None else "%s copy" % display . __unicode__ ( ) else : self . title = title if not title is None else display . __unicode__ ( ) self . save ( ) self . scorepanel_set = display . scorepanel_set . all ( ) else : self = display try : public_demo = self . scorepanel_set . get ( type = 'district' ) if self != display : self . scorepanel_set . remove ( public_demo ) demo_panel = copy ( public_demo ) demo_panel . id = None demo_panel . name = '%(display_title)s Demographics' % { 'display_title' : self . title } demo_panel . save ( ) self . scorepanel_set . add ( demo_panel ) else : demo_panel = public_demo demo_panel . score_functions . clear ( ) if len ( functions ) == 0 : return self for function in functions : if isinstance ( function , types . IntType ) : function = ScoreFunction . objects . get ( pk = function ) if isinstance ( function , types . StringTypes ) : function = ScoreFunction . objects . get ( pk = int ( function ) ) if type ( function ) == ScoreFunction : demo_panel . score_functions . add ( function ) demo_panel . save ( ) self . scorepanel_set . add ( demo_panel ) self . save ( ) except Exception , ex : logger . info ( 'Failed to copy ScoreDisplay %s to %s' , display . __unicode__ ( ) , self . __unicode__ ( ) ) logger . debug ( 'Reason: %s' , ex ) return self