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 8128077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:45:31+00:00 2026-06-06T07:45:31+00:00

I am getting an error _reverse_with_prefix() argument after * must be a sequence, not

  • 0

I am getting an error “_reverse_with_prefix() argument after * must be a sequence, not int” when I try to reverse. I previously hardcoded the parameter in the view but am trying to make it dynamic. Any advice?

View:

def add_review(request, product_id):
    p = get_object_or_404(Product, pk=product_id)
    if request.method == 'POST':
        form = ReviewForm(request.POST)
        if form.is_valid():
            form.save()
            #HARDCODED: return HttpResponseRedirect('/products/1/reviews/')
            return HttpResponseRedirect(reverse('view_reviews', args=(p.id)))
    else:
        form = ReviewForm()
    variables = RequestContext(request, {'form': form})
    return render_to_response('reserve/templates/create_review.html', variables)        


def view_reviews(request, product_id):
    product = get_object_or_404(Product, pk=product_id)
    reviews = Review.objects.filter(product_id=product_id)
    return render_to_response('reserve/templates/view_reviews.html', {'product':product, 'reviews':reviews},
    context_instance=RequestContext(request))


urlpatterns = patterns('reserve.views',
    url(r'^clubs/$', 'index'),
    url(r'^products/(?P<product_id>\d+)/reviews/$', 'view_reviews'),
    url(r'^products/(?P<product_id>\d+)/add_review/$', 'add_review'),
    url(r'^admin/', include(admin.site.urls)),
)
  • 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-06-06T07:45:33+00:00Added an answer on June 6, 2026 at 7:45 am

    Check args=(p.id) inside the reverse(), it must be args=(p.id,). The first form is treated as integer instead of a sequence.

    Refs the doc and the tutorial:

    A special problem is the construction of tuples containing 0 or 1
    items: the syntax has some extra quirks to accommodate these. Empty
    tuples are constructed by an empty pair of parentheses; a tuple with
    one item is constructed by following a value with a comma (it is not
    sufficient to enclose a single value in parentheses).

    Also, use 'reserve.views.view_reviews' instead of merely 'view_reviews', thus:

    reverse('reserve.views.view_reviews', args=(p.id,))
    

    Check the doc of reverse

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

Sidebar

Related Questions

I am getting error of System.MissingMethodException after I have an optional parameter in one
getting error while try to start service
Update getting error when i try to call the method from Activity: SQLiteDatabase db
I'm getting the following error message: Reverse for 'code_front' with arguments '()' and keyword
I seem to be getting a Caught NoReverseMatch error. I am not so sure
The error I'm getting: error C2664: 'v8::FunctionTemplate::New' : cannot convert parameter 1 from 'v8::Handle<T>
I keep getting error in my iPhone programing when I try to use pi.
Trying to reverse a string but getting error in Aggregate function private string Reverse(string
I am getting a 500 error when I try to deploy my app to
I am getting this error when trying to access my admin panel after updating

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.