title: Subtraction in Django
body: <p>I'm doing an inventory, and I have part of the code working correctly:  </p>
  
  <pre><code>def add_art_view(request, pk, template_name='invstock/art_form.html'):
      id = get_object_or_404(Stock, pk=pk)
      form = StockForm(request.POST or None, instance=id)
  
      context = {
          'form': form
      }
  
      if form.is_valid():
          form.save()
          messages.success(request, ('Register Edited Successfully'))
          return redirect('invstock:art_list_view')
  
      return render(request, template_name, context)
  </code></pre>
  
  <pre><code>{% extends "base.html" %}
  
  {% block content %}
      {% if user.is_authenticated %}
          &lt;h2&gt;&lt;a href="{% url 'invstock:art_list_view' %}"&gt;ART FORM&lt;/a&gt;&lt;/h2&gt;
              &lt;form method="post"&gt;{% csrf_token %}
                   &lt;div class="form-group"&gt;
                       &lt;label&gt;Cantidad&lt;/label&gt;{{ form.cantidad}}
                       &lt;label&gt;Cantidad a debitar&lt;/label&gt;{{ form.var_resta}}
                       &lt;label&gt;Name&lt;/label&gt;{{ form.name}}
                       &lt;label&gt;ID&lt;/label&gt;{{ form.id}}
                   &lt;/div&gt;
  
                   &lt;input type="submit" value="Submit" /&gt;
              &lt;/form&gt;
  
  {% endblock %}
  </code></pre>
  
  <pre><code>class StockForm(forms.ModelForm):
  
      var_resta = forms.DecimalField(initial= Decimal('0'), decimal_places=2, max_digits=5)
      name = forms.CharField(initial="None",)
  
      class Meta:
          model = Stock
          fields = [
              'id',
              'cantidad',
              'name',
              'var_resta',
          ]
  </code></pre>
  
  <pre><code>class Stock(models.Model):
  
      id = models.IntegerField(primary_key=True)
      cantidad = models.DecimalField(decimal_places=2, max_digits=5)
      var_resta = models.DecimalField(default=Decimal('0'), decimal_places=2, max_digits=5)
      name = models.CharField(default="None",max_length=100)
  </code></pre>
  
  <p>My intention is: to subtract the CANTIDAD field minus the VAR_RESTA field but from the views, and store the resulting value in the CANTIDAD field, something like<br>
  CANTIDAD = CANTIDAD - VAR_RESTA, I have dilated for weeks this, because in all the research, videos, courses, I have not been able to find the answer, you can only analyze how to do it from the template, but it is not what I need.<br>
  I Have found some examples like {{ myval|add:"-5" }}, or creating a template tag but this is far from what i want to do.<br>
  Any help would be really appreciated.  </p>