title: unsupported operand type(s) for -: 'decimal.Decimal' and 'float' | Django
body: <p>Sometimes it works fine and sometimes it displays the error.</p>
  <p><strong>ADMIN</strong></p>
  <p><strong>models.py</strong></p>
  <pre><code>class BarterAdminWallet(models.Model):
      admin_wallet_id = models.BigAutoField(primary_key=True)
      admin_wallet_balance = models.DecimalField(max_digits=60, decimal_places=2, default = 0.00)
      admin_tokens_assigned = models.DecimalField(max_digits=60, decimal_places=2, default = 0.00)
      admin_tokens_earned = models.DecimalField(max_digits=60, decimal_places=2, default = 0.00)
      admin_tokens_bought = models.DecimalField(max_digits=60, decimal_places=2, default = 0.00)
  
  
  class BarterAdminActionsTokens(models.Model):
      action_tokens_id = models.BigAutoField(primary_key=True)
      account_activation_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      newsletter_subscription_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      name_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      surname_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      add_languages_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      mobile_phone_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      avatar_image_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      profile_description_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      dob_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      linkedin_profile_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      facebook_profile_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      address_1_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
      address_2_tokens = models.DecimalField(max_digits=30, decimal_places=2, default = 0.00)
  </code></pre>
  <p><strong>USER</strong></p>
  <p><strong>views.py</strong></p>
  <pre><code>   adminwallet = BarterAdminActionsTokens.objects.get()
     registration_tokens = adminwallet.account_activation_tokens
  
     adminwallet = BarterAdminWallet.objects.get()
     adminwallet.admin_wallet_balance = adminwallet.admin_wallet_balance - float(registration_tokens)
     adminwallet.admin_tokens_assigned = adminwallet.admin_tokens_assigned + float(registration_tokens)
     adminwallet.save()
  
     token_status.user_account_activation_token_status = &quot;Awarded&quot;
     token_status.save()
  </code></pre>
  <p><strong>CODE EXPLANATION</strong></p>
  <ul>
  <li>All fields related to maths are of the decimal.</li>
  <li>Same code, When calculating sometimes calculates perfectly and show error on some occasion.</li>
  <li>Also this code is working absolutely fine in other apps.</li>
  </ul>