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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:34:03+00:00 2026-05-26T03:34:03+00:00

The view: def GRID_ServerDropDownSearch(request): if ‘r’ in request.GET and request.GET[‘r’]: r = request.GET[‘r’] servers

  • 0

The view:

 def GRID_ServerDropDownSearch(request):
         if 'r' in request.GET and request.GET['r']:
        r = request.GET['r']
        servers = SERVERS.objects.get(name=r)
    drives = servers.drives_set.all()[0:]
    memory = servers.memory_set.all()[0:]
    return render_to_response('GRID_ServerDropDownSearchResults.html',
    {'servers':servers, 'query':r, 'drives':drives, 'memory':memory})
    else:
    return render_to_response('GRID_search_form.html', {'error': True})

The form:

class ServerDropDownForm(forms.Form):

r = forms.ModelChoiceField(queryset = SERVERS.objects.all(), required=False)

The template:

 <div>
 <form action="/ServerDropDownSearch/" method="GET">
    {{ form.as_table }}
     <input type = "Submit" value = "Submit">
  </form>
  </div>

The resulting drop-down form works flawlessly. However, immediately to the left of the drop-down list is an “R” (capital r). I know it has to do with the “r” specified in the above code. (If I replace each incidence of r with, say, z then a “Z” appears). However:

  1. WHY does it get capitalized ? Is this just the default case specified in the engine ?
  2. How can I hide that “R” so that, instead, it can indicate “Select A Server”, or something more descriptive.

Thanks in advance.

  • 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-26T03:34:04+00:00Added an answer on May 26, 2026 at 3:34 am

    Django derives the label for a form field from the corresponding variable name, but “humanizes” it. For example, a field called my_variable would translate to “My variable”.

    The simplest way to fix this would be to give a more human-readable name to the field:

    server = forms.ModelChoiceField(queryset = SERVERS.objects.all(), required=False)
    

    However, you can also pass a string to use as the label via the form field’s label parameter:

    r = forms.ModelChoiceField(queryset = SERVERS.objects.all(), required=False, label='Select a server')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my view: def rsvp_list(request, id, template=rsvp/rsvp_list.html): rsvp = RSVP.objects.get(id=id) return render_to_response(template, { 'attendees':
I have the following code in a view: def controller_details(request, object_id): controller = Controller.objects.get(pk=object_id)
My view : def SeekDeals(request , reply_id): reply = SeekReply.objects.get(pk = reply_id) obj =
In my view: def delete_payment(request, id): thePayment = Payment.objects.filter(id=id) thePayment.delete() return HttpResponseRedirect('/invoices/open/') In my
#model class Promotion(models.Model): name = models.CharField(max_length=200) start_date = models.DateTimeField() end_date = models.DateTimeField() #view def
I tried to read a file in a view like this: def foo(request): f
Model: http://dpaste.com/96349/ View: def game_list(request): return render_to_response('games/game_list.html', { 'object_list': GameList.objects.published.all().order_by('position')}) Template: AttributeError at /games/
when i change the homepage view: def home(request): return render_to_response('homepage.html') to def home(request): return
In django/contrib/auth/views.py there is the definition of the logout view : def logout(request, next_page=None,
Let's say I have a view: def pony_view(request, arg1, arg2): ... Make ponies, etc

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.