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

  • Home
  • SEARCH
  • 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 6049027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:31:47+00:00 2026-05-23T07:31:47+00:00

The error says : get() takes exactly 2 arguments (3 given) I am sub

  • 0

The error says :

get() takes exactly 2 arguments (3 given)

I am sub classing DetailView as :

class MovieDetail(DetailView):
    template_name = 'examples/generic_movie_detail.html'
    template_object_name = 'movie'

    def get_queryset(self):
        movie = get_object_or_404(Movies, actors__name__contains = self.args[0])
        return movie 

and using url as :

(r'^movie/detail/(\w+)', MovieDetail.as_view())

Now i want to retrieve movies by any particular actor say (‘Tom’) then i will pass Tom through url as “/movie/detail/tom ” . I will work it out in my template then .

Traceback :

File "C:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python26\lib\site-packages\django\views\generic\base.py" in view
  47.             return self.dispatch(request, *args, **kwargs)
File "C:\Python26\lib\site-packages\django\views\generic\base.py" in dispatch
  68.         return handler(request, *args, **kwargs)

Exception Type: TypeError at /examples/movie/detail/aamir
Exception Value: get() takes exactly 2 arguments (3 given)

  • 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-23T07:31:48+00:00Added an answer on May 23, 2026 at 7:31 am

    You are passing BaseDetailView.get arguments via your URL capturing group (the (\w+)) when it doesn’t accept arguments.

    class BaseDetailView(SingleObjectMixin, View):
        def get(self, request, **kwargs): #<-- only keyword args
    

    Either pass it keyword arguments or override the get method to accept *args or your specific argument.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get an error that says Parse error: syntax error, unexpected T_PRIVATE in E:\PortableApps\xampp\htdocs\SN\AC\ACclass.php
Like the title says, the error I get is the following: An invalid '/'
I am getting an error that says: error: looser throw specifier for 'virtual CPLAT::CP_Window::~CP_Window()'
I've got an error in my build which says: Error 12 Cannot implicitly convert
I'm getting the NRE error that says: Object reference not set to an instance
I got this error twice. it says error: redefinition of '-[SampleTableViewController tableView:cellForRowAtIndexPath:]'
Why am I getting these errors? alt text http://img39.imageshack.us/img39/2203/help.tif It says: Error: Request for
Drupal is giving me an error message which says : An illegal choice has
In the XMLHttpRequest Spec it says that: The DONE state has an associated error
The book says The WPF Button class only adds two simple concepts on top

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.