import six

from .node import Node


@six.python_2_unicode_compatible
class Investment(Node):
    """Represents a Investment (investor-investment) on CrunchBase"""

    KNOWN_PROPERTIES = [
        'type',
        'uuid',
        'money_invested',
        'money_invested_currency_code',
        'money_invested_usd',
    ]

    KNOWN_RELATIONSHIPS = [
        'funding_round',
        'invested_in',
    ]

    def __str__(self):
        return u'{series} {invested_in}'.format(
            series=self.funding_round.series,
            invested_in=self.invested_in.name,
        )

    def __repr__(self):
        return self.__str__()

import six

from .node import Node


@six.python_2_unicode_compatible
class Investment(Node):
    """Represents a Investment (investor-investment) on CrunchBase"""

    KNOWN_PROPERTIES = [
        'type',
        'uuid',
        'money_invested',
        'money_invested_currency_code',
        'money_invested_usd',
    ]

    KNOWN_RELATIONSHIPS = [
        'funding_round',
        'invested_in',
        'investors',
    ]

    def __str__(self):
        if self.money_invested:
            return u'{invested}'.format(
                self.money_invested
            )

        if hasattr(self, 'investors'):
            return u'{investors}'.format(self.investors)

        if self.type:
            return u'{type}'.format(self.type)

        return u'Investment'

    def __repr__(self):
        return self.__str__()

Add new relationship to Investment resource
Add new relationship to Investment resource

  import six
  
  from .node import Node
  
  
  @six.python_2_unicode_compatible
  class Investment(Node):
      """Represents a Investment (investor-investment) on CrunchBase"""
  
      KNOWN_PROPERTIES = [
          'type',
          'uuid',
          'money_invested',
          'money_invested_currency_code',
          'money_invested_usd',
      ]
  
      KNOWN_RELATIONSHIPS = [
          'funding_round',
          'invested_in',
+         'investors',
      ]
  
      def __str__(self):
+         if self.money_invested:
-         return u'{series} {invested_in}'.format(
+             return u'{invested}'.format(
+                 self.money_invested
-             series=self.funding_round.series,
-             invested_in=self.invested_in.name,
-         )
+             )
+ 
+         if hasattr(self, 'investors'):
+             return u'{investors}'.format(self.investors)
+ 
+         if self.type:
+             return u'{type}'.format(self.type)
+ 
+         return u'Investment'
  
      def __repr__(self):
          return self.__str__()
  
Add new relationship to Investment resource
## Code Before:
import six

from .node import Node


@six.python_2_unicode_compatible
class Investment(Node):
    """Represents a Investment (investor-investment) on CrunchBase"""

    KNOWN_PROPERTIES = [
        'type',
        'uuid',
        'money_invested',
        'money_invested_currency_code',
        'money_invested_usd',
    ]

    KNOWN_RELATIONSHIPS = [
        'funding_round',
        'invested_in',
    ]

    def __str__(self):
        return u'{series} {invested_in}'.format(
            series=self.funding_round.series,
            invested_in=self.invested_in.name,
        )

    def __repr__(self):
        return self.__str__()

## Instruction:
Add new relationship to Investment resource
## Code After:
import six

from .node import Node


@six.python_2_unicode_compatible
class Investment(Node):
    """Represents a Investment (investor-investment) on CrunchBase"""

    KNOWN_PROPERTIES = [
        'type',
        'uuid',
        'money_invested',
        'money_invested_currency_code',
        'money_invested_usd',
    ]

    KNOWN_RELATIONSHIPS = [
        'funding_round',
        'invested_in',
        'investors',
    ]

    def __str__(self):
        if self.money_invested:
            return u'{invested}'.format(
                self.money_invested
            )

        if hasattr(self, 'investors'):
            return u'{investors}'.format(self.investors)

        if self.type:
            return u'{type}'.format(self.type)

        return u'Investment'

    def __repr__(self):
        return self.__str__()
