6
使用Django Crispy Forms我想補充一類在我的提交按鈕這樣的:Django的脆皮形式添加事業部圍繞提交按鈕
<div class="col-lg-offset-3 col-lg-9">
<input type="submit" value="Log Me In" class="btn btn-default" />
</div>
這是我迄今管理:
<input type="submit" value="Log Me In" class="btn btn-default" />
使用此代碼:
def __init__(self, host=None, *args, **kwargs):
super(AuthenticationForm, self).__init__(*args, **kwargs)
self.host = host
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-lg-3'
self.helper.field_class = 'col-lg-8'
self.helper.add_input(
Submit('submit', 'Log Me In', css_class='btn btn-default',)
)
正如你所看到的,我幾乎在那裏,有沒有辦法將多餘的d IVS?
感謝明確的例子! – freb