Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6149123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:23:56+00:00 2026-05-23T19:23:56+00:00

I have trouble transforming the following code into the new django 1.3 class-based generic

  • 0

I have trouble transforming the following code into the new django 1.3 class-based generic view format. Specifically, I don’t understand how I can pass the ‘extra_context’ to the class based view. Can someone help me transform this code to the new notation? or post a link to a good example? I’ve read the docs but the example is very flimsy.

def return_event_list_object(request, username, queryset, entries_per_page, param1, param2):
    ...
    ...
    return object_list(request, queryset = queryset,
            template_name = 'myapp/list_events.html', 
            paginate_by = int(entries_per_page), 
            template_object_name = 'event',
            extra_context = {'param1': param1, 
                            'param2': param2, } )

I appreciate your input!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:23:56+00:00Added an answer on May 23, 2026 at 7:23 pm

    The extra_context section of the docs explains how to add items to the context:

    Class-based views don’t provide an extra_context argument. Instead, you subclass the view, overriding get_context_data(). For example:

    In your case, try:

    class MyListView(ListView):
        def get_context_data(self, **kwargs):
            context = super(MyListView, self).get_context_data(**kwargs)
            context.update({
                'param1': kwargs['param2'],
                'param2': kwargs['param1']
            })
        return context
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trouble with the following piece of code. When I go through with
I have trouble to get gluLookAt working. I have the following code which works
I have trouble when designing classes like this class C1 { public: void foo();
I have trouble finding way to correctly refactor this code so that there would
i have trouble with calling one view controller to another view controller using segue
I have trouble getting a form element value into a jstl tag. I am
I have trouble merging IronPython.dll, IronPython.Modules.dll, Microsoft.Dynamic.dll, Microsoft.Scripting.dll and Microsoft.Scripting.Metadata.dll into my application. The
I have trouble integrating jquery mobile for my django project. Especially the log-in functionality
I have trouble saving my date field into database using CakePHP. Table column name
I have trouble compiling a class, which has function pointers as member variables. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.