2012-05-10 5 views
0

양식 마법사 안에 페이팔 양식을 넣으려고합니다. 필드가 표시되고 있지만 어떤 이유로 든 버튼이 표시되지 않습니다.Django 양식 마법사 및 django-paypal

보기 안에 양식 마법사를 래핑했는데 제대로 작동합니다. 누락 된 유일한 것은 페이팔 버튼입니다.

views.py

def add(request): 
    paypal_dict = { 
     "cmd": "_xclick-subscriptions", 
     "business": "[email protected]", 
     "p3": 1,       # duration of each unit (depends on unit) 
     "t3": "M",       # duration unit ("M for Month") 
     "src": "1",      # make payments recur 
     "sra": "1",      # reattempt payment on payment error 
     "no_note": "1",     # remove extra notes (optional) 
     "notify_url": "http://www.example.com/your-ipn-location/", 
     "return_url": "http://www.example.com/your-return-location/", 
     "cancel_return": "http://www.example.com/your-cancel-location/", 
     "custom": request.user.id 
    } 

    silver_payment = { 
     "a3": "15", 
     "item_name": "Silver Business Profile", 
    } 

    platinum_payment = { 
     "a3": "25", 
     "item_name": "Platinum Business Profile", 
    } 

    # add other keys from paypal_dict 
    silver_payment.update(paypal_dict) 
    platinum_payment.update(paypal_dict) 

    initial = { 
     '3':silver_payment, 
     '4':platinum_payment, 
    } 

    #create form wizard 
    form = AddWizard.as_view([AddForm1, AddForm2, AddForm3, PayPalPaymentsForm,PayPalPaymentsForm], 
      initial_dict = initial, 
      condition_dict = { 
       '1': basic_ad_selected, 
       '2': silver_ad_selected, 
       '3': silver_ad_selected, 
       '4': platinum_ad_selected 
      }) 

    return form(context=RequestContext(request), request=request) 

템플릿 :

{% block content %} 

{% load bootstrap %} 

<h2>Payment Information</h2> 

CARD FORM 

<form action="" method="POST">{% csrf_token %} 

{{ wizard.management_form }} 

{% if wizard.form.forms %} 
    {{ wizard.form.management_form }} 
    {% for form in wizard.form.forms %} 
     {{ form|bootstrap }} 

    {% endfor %} 
{% else %} 
    {{ wizard.form|bootstrap }} 

{% endif %} 
<br/><br/> 
{% if wizard.steps.prev %} 
<button class="btn" name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">&laquo; Go Back</button> 
{% endif %} 
<button class="btn btn-primary" type="submit" />Next &raquo;</button> 
</form> 
{% endblock %} 

나는 페이팔 폼의 모든 필드가 표시 왜 확실하지 오전하지만, 부트 스트랩 태그가 없습니다 버튼 자체

답변

0

했다 버튼을 제거하는 중 ...

버튼이 표시됩니다.

관련 문제