嘿,我刚刚将Mac上的Sourcetree更新为最新版本(2.2).git-flow去哪儿了?
我该如何重新启用此功能?
我没有它就迷失了自己!
我有一个Django crispy表单:一个典型的注册表单,包含电子邮件地址,密码字段和提交操作.
我有一个隐藏字段从我的urls python文件传递到Django crispy表单,名为'billing_secret'.不同的URL的计费秘密是不同的.
目标:要有一个条款和条件单选复选框启用/禁用特定计费秘密的提交按钮,因此url.
我需要添加两件事.
这是我到目前为止(不起作用).道歉我完全不熟悉Python.
email = forms.EmailField(label=_("Email"))
password1 = forms.CharField(widget=forms.PasswordInput,label=_("Password"))
billing_secret = forms.CharField()
termsandcond = forms.TypedChoiceField(
label = "Do you agree to the T&C's?",
choices = ((1, "Yes"), (0, "No")),
coerce = lambda x: bool(int(x)),
widget = forms.RadioSelect,
initial = '0',
required = True,
)
def __init__(self, *args, **kwargs):
billing_secret = kwargs.pop('billing_secret', None)
super(RegistrationForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_method = 'post'
self.helper.form_action = '.'
self.helper.layout = Layout(
Field('email', placeholder=_("Email")),
Field('password1', placeholder=_("Password")),
Field('billing_secret', …Run Code Online (Sandbox Code Playgroud)