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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:16:42+00:00 2026-05-11T09:16:42+00:00

Template: <form method=POST action=/Bycategory/> <input type=radio name=andor1 value=1 checked> <input type=radio name=andor1 value=2> <select

  • 0

Template:

<form method='POST' action='/Bycategory/'> <input type='radio' name='andor1' value=1 checked> <input type='radio' name='andor1' value=2> <select id='pathology_id' name='pathology_id'>     {% for pathology in pathology_list %}         <option value='{{ pathology.id }}'>{{ pathology.pathology }}</option>     {% endfor %} </select> 

There are actually three search selects(pathology, commodity, technology) The user can do and/or for a mix or match of the three, which is why I need the and/or option in the views.py.

The views.py:

def Bypub(request):     andor1 = request.POST['andor1']     pathology_id = request.POST['pathology_id']     p = get_object_or_404(Pathology, pk=pathology_id)     pub1=Publication.objects.exclude(pathpubcombo__pathology__id= 1).filter(pathpubcombo__pathology=p)     list=[]     andlist=[]     for publication in pub1:         if andor1 == 1:             if publication not in list:                 list.append(publication)         if andor1 == 2:             if publication in list:                 andlist.append(publication)                 #list=andlist     return render_to_response('search/categories.html', {         'andor1' : andor1,         'pub1': pub1,         'pathology': p,         'list' : list,         'andlist' : andlist,     },         context_instance=RequestContext(request)     ) 

I know that all my code works without error, but the line (if andor1 ==1:) and (if andor1 ==2:) is being ignored. I suspect that the value for andor1 does not appear at the point where I’m using it. I think it doesn’t actually render until after the return render_to_response, because it appears in the next template as a value, otherwise I would see some kind of response at the if andor1 ==1: in the template. Any suggestions?

  • 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. 2026-05-11T09:16:43+00:00Added an answer on May 11, 2026 at 9:16 am

    thank you! The quotes worked. My thinking was stuck on the fact that the value was a numeric and shouldn’t need quotes, so I didn’t try that.

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

Sidebar

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.