谁能帮我在同一页面上垂直制作两列表单。我也附上了编码。我的问题是如何在form.py中编写两个表单以及如何在模板中进行更改(login.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 %}