title: NameError: name 'ReleaseDeal' is not defined in Django
body: <p>i'm getting NameError:  for the following code...</p>
  
  <pre><code>d = [('1','as'),('2','sd')]
  for i in d:
      RD = ReleaseDeal(int(i[0]))
      print(RD)
  
  def ReleaseDeal(a):
      RD = '''&lt;ReleaseDeal&gt;&lt;DealReleaseReference&gt;R'''+ no +'''&lt;/DealReleaseReference&gt;&lt;Deal&gt;&lt;DealTerms&gt;&lt;CommercialModelType&gt;AsPerContract&lt;/CommercialModelType&gt;
          &lt;Usage&gt;&lt;UseType UserDefinedValue="GoogleMusicBasic"&gt;UserDefined&lt;/UseType&gt; &lt;UseType UserDefinedValue="SscSnmLocker"&gt;UserDefined&lt;/UseType&gt;
          &lt;UseType UserDefinedValue="GoogleMusicSubscription"&gt;UserDefined&lt;/UseType&gt;&lt;/Usage&gt;&lt;TerritoryCode&gt;Worldwide&lt;/TerritoryCode&gt;&lt;PriceInformation&gt;
          &lt;PriceType Namespace="DPID:""&gt;13&lt;/PriceType&gt;&lt;/PriceInformation&gt;&lt;ValidityPeriod&gt;&lt;StartDate&gt;2018-10-04&lt;/StartDate&gt;&lt;/ValidityPeriod&gt;
          &lt;/DealTerms&gt;&lt;/Deal&gt;&lt;/ReleaseDeal&gt;'''
      return RD
  </code></pre>
  
  <p>i'm getting following errors...</p>
  
  <pre><code>Traceback (most recent call last):
    File "example.py", line 3, in &lt;module&gt;
    RD = ReleaseDeal(int(i[0]))
  NameError: name 'ReleaseDeal' is not defined
  </code></pre>
  
  <p>please help me on this , Thanks in advance..</p>