title: Problems with UpdateView in Django
body: <p>I've looked on this site for help with UpdateView, and while I've found content dealing with setting it up, I am having trouble making it happen myself. I'm not sure what the problem is, and at this point rather than continue to tear my hair out I figured someone here could easily spot my mistake.</p>
  
  <p>I'm trying to have a list of teams, with edit buttons to the right of them. Whenever an edit button is clicked, it's supposed to take the user to a page where the fields of that particular team model can be updated.
  Whenever I click on the edit button in the code below, I get a NoReverseMatch error. What am I doing wrong?</p>
  
  <p>The view.py code:</p>
  
  <pre><code>class TeamUpdate(UpdateView):
  model = Team
  fields = ['team_name', 'sport', 'sport_season']
  </code></pre>
  
  <p>The url.py code:</p>
  
  <pre><code> url(r'(?P&lt;name&gt;[0-9]+d)/$', TeamUpdate.as_view(), name='team_update'),
  </code></pre>
  
  <p>The relevant template code:</p>
  
  <pre><code>        &lt;form method="POST" action=""&gt;
              {% csrf_token %}
          &lt;table class="table"&gt;
  
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Team Name&lt;/th&gt;
                  &lt;th&gt;Sport&lt;/th&gt;
                  &lt;th&gt;Season&lt;/th&gt;
                  &lt;th&gt;Preferences&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              {% for team in teams %}
              &lt;tr&gt;
                  &lt;td&gt;{{team}}&lt;/td&gt;
                  &lt;td&gt;{{team.sport_verbose}}&lt;/td&gt;
                  &lt;td&gt;{{team.season_verbose}}&lt;/td&gt;
                  &lt;td&gt; &lt;input type="submit" class="btn btn-sm btn-primary" href = '{% url "team_update" team.team_name %}' value="Edit" &gt;&lt;/td&gt;
              &lt;/tr&gt;
              {% endfor %}
          &lt;/tbody&gt;
          &lt;/table&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>Edit:
  so I changed my regex to  <code>url(r'(?P&lt;name&gt;)$', TeamUpdate.as_view(), name='team_update'),</code> 
  from what was above, figuring that this would substitute the name of the team into the url, but the same NoReverseMatch error is coming up. </p>