title: How to retrieve the week value from the django model to view and pass it to the dictionary?
body: <p>I just want to retrieve the week value from the model to view and pass it to the dictionary. What am I doing wrong?</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>import datetime
  from datetime import date
  from django.db import models
  
  
  class WeekNumber(models.Model):
      """Week number"""
      objects = models.Manager()
  
      @staticmethod
      def number_of_week():
          week = date.today().strftime("%U")
          return week
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>from django.views import View
  from django.shortcuts import render
  from .models import WeekNumber
  
  
  class WeekNumbers(View):
      model = WeekNumber
      template_name = 'week_number'
  
      def get(self, request):
          week = WeekNumber.objects.get()
          context = {'week': week}
          return render(request, 'week_number.html', context)
  </code></pre>
  
  <p><strong>Template</strong></p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;Week {{ week }}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>and I have in browser:</p>
  
  <p><code>Week WeekNumber object (1)</code></p>
  
  <p>Many thanks in advance!</p>