title: Inheritance between 2 django classes
body: <p>I would like to inherite method from a first class to a second one separated in two different files. I'm getting a little issue according to arguments given in my method.</p>
  
  <p>I have a file named : <strong>main.py</strong></p>
  
  <pre><code>class CustomCreateView(LoginRequiredMixin, SuccessMessageMixin, CreateView):
      template_name = '...'
      model = ...
  
      def get_context_data(self, **kwargs):
          """ Update the context data with query_string.
          """
          context = super(CustomCreateView, self).get_context_data(**kwargs)
          context['title'] = _("Add new ") + str(self.model._meta.verbose_name)
  
          context['actual_page'] = get_actual_page(self.request)
          context['actual_search'] = get_actual_search(self.request)
          context['actual_sort'] = get_actual_sorting(self.request, self.default_sort_params[0])
          context['actual_pagination'] = get_pagination(mylist, self.pk)
  
          return context
  
  def get_actual_page(request):
      actual_page = request.GET.get('page', None)
      ...
      return actual_page
  
  
  def get_actual_sorting(request, default):
      actual_sorting = request.GET.get('sorting', default)
      return actual_sorting
  
  
  def get_actual_search(request):
      q = request.GET.get('q', '')
      return q
  
  
  def get_pagination(mylist, pk):
      actual_pagination = [mylist[x:x + settings.PAGE_LIMIT] for x in range(0, len(mylist), settings.PAGE_LIMIT)]
      ...
      return actual_pagination
  </code></pre>
  
  <p>And I have another file : <strong>views.py</strong></p>
  
  <pre><code>class MyFormView(PermissionRequiredMixin, CustomCreateView):
  
      def get_context_data(self, **kwargs):
          context = super(MyFormView, self).get_context_data(**kwargs)
  
          page_row_ids = self.request.session.get('result_recordset', [])
  
          my_pagination = context['actual_pagination']
          actual_pagination, first_page, last_page, page_number = my_pagination(page_row_ids, pk)
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>In my first file, How I can write arguments in <code>context['actual_pagination'] = get_pagination(mylist, self.pk)</code> in order to insert any list when I will call this one (e.g <code>page_row_ids</code>)?</p>
  
  <p>Thank you very much</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I created a function in main.py file :</p>
  
  <pre><code>def get_pagination(mylist, pk)
  </code></pre>
  
  <p>This function takes 2 arguments : </p>
  
  <ul>
  <li><code>myList</code>: generic argument which have to be replaced by a <code>list</code></li>
  <li><code>pk</code>: generic argument which have to be replaced by an <code>id</code></li>
  </ul>
  
  <p>I call this function in my <code>get_context_data()</code> method located in my <code>CustomCreateView</code> class.</p>
  
  <p>Now I have another class (in a second file) which inherite from <code>CustomCreateView</code>. And I would like to call my method <code>get_pagination</code> by replacing <code>myList</code> argument by <code>page_row_ids</code> and <code>pk</code> by <code>pk</code>.</p>
  
  <p>So in my child class, I would like to get :</p>
  
  <pre><code>context['actual_pagination'] = my_pagination(myList=page_row_ids, pk=pk)
  actual_pagination, first_page, last_page, page_number = my_pagination(myList=page_row_ids, pk=pk)
  </code></pre>
  
  <blockquote>
    <p>File "/home/Bureau/Projets/my_project/src/app/views.py" in
    get_context_data
      872.         context = super(MyFormView, self).get_context_data(**kwargs)</p>
    
    <p>File "/home/.pyenv/versions/3.6.2/envs/3.6.2/src/app/main.py" in
    get_context_data
      50.         context['actual_pagination'] = get_pagination(myList, self.pk)</p>
    
    <p>Exception Type: AttributeError at /slug/edit/41 Exception Value:
    'MyFormView' object has no attribute 'myList'</p>
  </blockquote>
  
  <p>How I can do that ? Hopfully it's more clearable with my edit</p>