-2
任何人都可以請我幫助我在同一頁面垂直製作兩列表單。我也附加了編碼。我的問題是如何在form.py中編寫兩個表單以及如何在模板中進行更改(登錄。 html)使2個窗體顯示成兩列??請幫我出來.. 在此先感謝!如何在同一頁面創建兩列文件?
class Login(AuthenticationForm):
region = forms.ChoiceField(label=_("Region"), required=False)
username = forms.CharField(label=_("User Name"))
password = forms.CharField(l![enter image description here][2]abel=_("Password"),
widget=forms.PasswordInput(render_value=False))
t= [('http:google.com','Google'),('http://kent.com','University of Kent')]
FederatedLogin = forms.ChoiceField(label= _("Select one of the third party "),choices= t)
tenant = forms.CharField(required=False, widget=forms.HiddenInput())
login.html
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}
{% trans "Log In" %}
{% endblock %}
{% block modal_class %}
login
{% if hide %}
modal hide
{% endif %}
{% endblock %}
{% block form_action %}{% url 'login' %}{% endblock %}
{% block autocomplete %}{{ HORIZON_CONFIG.password_autocomplete }}{% endblock %}
{% block modal-body %}
<fieldset>
{% if request.user.is_authenticated and 'next' in request.GET %}
<div class="control-group clearfix error">
<span class="help-inline"><p>{% trans "You don't have permissions to access:" %}</p>
<p><b>{{ request.GET.next }}</b></p>
<p>{% trans "Login as different user or go back to" %}
<a href="{% url 'horizon:user_home' %}">{% trans "home page" %}</a></p>
</span>
</div>
{% endif %}
{% if next %}<input type="hidden" name="{{ redirect_field_name }}" value="{{ next }}" />{% endif %}
{% include "horizon/common/_form_fields.html" %}
</fieldset>
{% endblock %}
{% block modal-footer %}
<button type="submit" class="btn btn-primary pull-right">{% trans "Sign In" %}</button>
{% endblock %}