У меня есть форма, которая похожа на
from django import forms
from captcha.fields import CaptchaField
from django.shortcuts import render_to_response
from OEConnector import *
class Personal_info_updateForm(forms.Form):
title_choices = ( ('herr', 'Herr'), ('frau', 'Frau'))
#Dates tuple list
dates=[]
for x in range(1,32):
dates.append(tuple([x.__str__(),x.__str__()]))
dates = tuple(dates)
#Months tuple list
months = (
('jan','Januar'),
('feb','Februar'),
('mar','Marz'),
('apr','April'),
('may','Mai'),
('jun','Juni'),
('jul','Juli'),
('aug','August'),
('sep','September'),
('oct','Oktober'),
('nov','November'),
('dec','Dezember'),
)
#Years tuple list
years=[('','')]
for y in range(1930,2050):
years.append(tuple([y.__str__(),y.__str__()]))
years = tuple(years)
#Get list of countries from OpenERP and create countries tuple list
title = forms.ChoiceField(label="Anrede", choices=title_choices, widget=forms.RadioSelect)
first_name = forms.CharField(label="Vorname", required=False)
last_name = forms.CharField(label="Nachname", required=False)
date_of_birth = forms.ChoiceField(choices=dates, widget=forms.Select, required=False)
month_of_birth = forms.ChoiceField(choices=months, widget=forms.Select, required=False)
year_of_birth = forms.ChoiceField(choices=years, widget=forms.Select, required=False)
email = forms.EmailField(label='Email',required=False)
phone = forms.CharField(label="Phone", required=False)
mobile = forms.CharField(label="Mobile", required=False)
я вызываю эту форму в моем шаблоне.
Дата рождения:
Месяц рождения:
Год рождения:
Теперь я хочу, чтобы эти три поля были в одной строке, как
Дата рождения: Месяц рождения: Год рождения:
Мой шаблон похож на
<form action="" method="POST">
<table style="color:black;text-align:left; margin-left: 20px;">
{{ form.as_table }}
</table>
<input type="submit" value="UPDATE">
</form>
хочу как
Дата рождения: Месяц рождения: Год рождения:
Заранее спасибо