<s> import os <EOL> import pdb <EOL> import sys <EOL> import tempfile <EOL> sys . path . append ( "<STR_LIT>" ) <EOL> from translator . toscalib . tosca_template import ToscaTemplate <EOL> from core . models import DashboardView , Site , Deployment , SiteDeployment <EOL> from xosresource import XOSResource <EOL> class XOSDashboardView ( XOSResource ) : <EOL> provides = "<STR_LIT>" <EOL> xos_model = DashboardView <EOL> copyin_props = [ "<STR_LIT:url>" , "<STR_LIT>" ] <EOL> def get_xos_args ( self ) : <EOL> return super ( XOSDashboardView , self ) . get_xos_args ( ) <EOL> def postprocess ( self , obj ) : <EOL> for deployment_name in self . get_requirements ( "<STR_LIT>" ) : <EOL> deployment = self . get_xos_object ( Deployment , deployment_name ) <EOL> if not deployment in obj . deployments . all ( ) : <EOL> print "<STR_LIT>" % ( obj , deployment ) <EOL> obj . deployments . add ( deployment ) <EOL> obj . save ( ) <EOL> def can_delete ( self , obj ) : <EOL> return super ( XOSDashboardView , self ) . can_delete ( obj ) </s>
