Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » slightly complicated radio input question [RSS Feed]

#1 Dec. 11, 2010 01:12:48

y.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

slightly complicated radio input question


hi

I want to create a form with django that has a radio selection that
looks like

<input type="radio" name="inv_range_flag" value="0" checked> Entire
Range (as in the file)<br>
<input type="radio" name="inv_range_flag" value="1"> Specified
Range:   
<H>Starting time</H>
<input type="text" size="5" value="1">   
<H>Ending time</H>
<input type="text" size="5" value="100"><br>
<input type="radio" name="inv_range_flag" value="2"> Maximum
Temperature (Δ<i>T<sub>M</sub></i>) only, with
<select>
<option>Savitzki-Golay</option><!--pass string "SG"-->
<option>polynomial</option><!--pass string "pol"-->
<option>no</option><!--pass string "none"-->
</select>

any idea how to write the form class to represent this?

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 11, 2010 07:41:19

Ilian I.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

slightly complicated radio input question


Hi,

there is a radio select widget for Django Forms ->http://docs.djangoproject.com/en/dev/ref/forms/widgets/On Sat, Dec 11, 2010 at 12:59 AM, yiftah <yifta...@hotmail.com> wrote:

> hi
>
> I want to create a form with django that has a radio selection that
> looks like
>
> <input type="radio" name="inv_range_flag" value="0" checked> Entire
> Range (as in the file)<br>
> <input type="radio" name="inv_range_flag" value="1"> Specified
> Range:
> <H>Starting time</H>
> <input type="text" size="5" value="1">
> <H>Ending time</H>
> <input type="text" size="5" value="100"><br>
> <input type="radio" name="inv_range_flag" value="2"> Maximum
> Temperature (Δ<i>T<sub>M</sub></i>) only, with
> <select>
> <option>Savitzki-Golay</option><!--pass string "SG"-->
> <option>polynomial</option><!--pass string "pol"-->
> <option>no</option><!--pass string "none"-->
> </select>
>
> any idea how to write the form class to represent this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>


--
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Dec. 13, 2010 15:52:31

y.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

slightly complicated radio input question


thanks Ilian, I used the RadioSelect widget to create a radio list.
but i want to create text/select elements between the radio elements
(as in my example above)
any ideas?

yiftah

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Dec. 14, 2010 18:47:27

Andre T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

slightly complicated radio input question


My idea would be to use the MultiWidget class with some templating to do the
HTML part.http://www.hoboes.com/Mimsy/hacks/django-forms-edit-inline/multiwidgets-templates/shine
some light on the subject, but I'm not sure how outdated it might be (the
blog post is from 2007 IIRC...)

I'm at work right now, so I can't really test this out for you. I would
suggest spending some time digging through the class definition given that
the documentation is quite lacking (or my google-fu is not as sharp as
before). I'll try to do that myself later and maybe even try answer a couple
SO questions along with yours.

Good luck, keep us posted.


Sincerely,
Andre Terra (airstrike)

On Mon, Dec 13, 2010 at 13:52, yiftah <yifta...@hotmail.com> wrote:

> thanks Ilian, I used the RadioSelect widget to create a radio list.
> but i want to create text/select elements between the radio elements
> (as in my example above)
> any ideas?
>
> yiftah
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » slightly complicated radio input question [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support