~homeworkprod/byceps

ref: 6083c64abf465c011eb6b8963e0fd7d010da0d58 byceps/byceps/blueprints/shop_order_admin/forms.py -rw-r--r-- 907 bytes
6083c64a — Jochen Kupperschmidt Pre-select bank transfer as the default payment method for orders in the mark-as-paid form 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
byceps.blueprints.shop_order_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""

from wtforms import RadioField, TextAreaField
from wtforms.validators import InputRequired, Length

from ...services.shop.order.models.payment import PaymentMethod
from ...util.l10n import LocalizedForm


class CancelForm(LocalizedForm):
    reason = TextAreaField('Begründung', validators=[InputRequired(), Length(max=200)])


PAYMENT_METHOD_CHOICES = [
    (PaymentMethod.bank_transfer.name, 'Überweisung'),
    (PaymentMethod.cash.name, 'Barzahlung'),
    (PaymentMethod.direct_debit.name, 'Lastschrift'),
]


class MarkAsPaidForm(LocalizedForm):
    payment_method = RadioField('Zahlungsart',
        choices=PAYMENT_METHOD_CHOICES,
        default=PAYMENT_METHOD_CHOICES[0][0],
        validators=[InputRequired()])