Does not displayed radio button in tutorial04

20 views
Skip to first unread message

Mats

unread,
Sep 11, 2022, 2:50:04 PM9/11/22
to Django users
Hi, Member

I am going through the tutorial at docs.djangoproject.com." I am implementing a form in "Writing your first Django app, part 4" but when I enter the code as per the tutorial, the radio buttons on the form do not appear.


I think it is because the contents of the fieldset element are not being rendered, but why is this happening? I am running django 4.1, latest version of Chrome.

The source code of the displayed page is as follows:

<form action="/polls/1/vote/" method="post">
    <input type="hidden" name="csrfmiddlewaretoken" value="Kt8oNcQx8e6fFF2JAxUOqGDVXAwRis8IiRs6B8kx33u3lNAFD6pH1k9fdYAHR8Zr">
    <fieldset>
        <legend><h1>What&#x27;s up</h1></legend>
       

    </fieldset>
    <input type="submit" value="Vote">
    </form>
<a href="/polls/">return index</a>

----
Mats

Snsk Mats

unread,
Oct 26, 2022, 9:46:26 PM10/26/22
to django...@googlegroups.com
Hi Member,

I solved this problem. I missed some of the content of the following sections.


In particular, the following statements.

# Create three choices.
>>> q.choice_set.create(choice_text='Not much', votes=0)
<Choice: Not much>
>>> q.choice_set.create(choice_text='The sky', votes=0)
<Choice: The sky>
>>> c = q.choice_set.create(choice_text='Just hacking again', votes=0)

Thanks!


2022年9月12日(月) 3:49 Mats <shi...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0af1422e-69f4-43b7-9cf6-6e78cd4df256n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages