from django import forms

from .models import Ticket


class TicketForm(forms.ModelForm):
    terms = forms.BooleanField(required=True)
    code = forms.CharField(required=True)

    class Meta:
        model = Ticket
        fields = ('name', 'phone' , 'mail',)

    def clean_phone(self):
        code = self.data.get('code')
        phone = self.cleaned_data.get('phone')
        return '%s %s' % (code, phone)
3853f525f3a407f1c5dfb944ba0bda057c379510
<mask token>


class TicketForm(forms.ModelForm):
    <mask token>
    <mask token>


    class Meta:
        model = Ticket
        fields = 'name', 'phone', 'mail'
    <mask token>

<mask token>


class TicketForm(forms.ModelForm):
    <mask token>
    <mask token>


    class Meta:
        model = Ticket
        fields = 'name', 'phone', 'mail'

    def clean_phone(self):
        code = self.data.get('code')
        phone = self.cleaned_data.get('phone')
        return '%s %s' % (code, phone)

<mask token>


class TicketForm(forms.ModelForm):
    terms = forms.BooleanField(required=True)
    code = forms.CharField(required=True)


    class Meta:
        model = Ticket
        fields = 'name', 'phone', 'mail'

    def clean_phone(self):
        code = self.data.get('code')
        phone = self.cleaned_data.get('phone')
        return '%s %s' % (code, phone)

from django import forms
from .models import Ticket


class TicketForm(forms.ModelForm):
    terms = forms.BooleanField(required=True)
    code = forms.CharField(required=True)


    class Meta:
        model = Ticket
        fields = 'name', 'phone', 'mail'

    def clean_phone(self):
        code = self.data.get('code')
        phone = self.cleaned_data.get('phone')
        return '%s %s' % (code, phone)

from django import forms

from .models import Ticket


class TicketForm(forms.ModelForm):
    terms = forms.BooleanField(required=True)
    code = forms.CharField(required=True)

    class Meta:
        model = Ticket
        fields = ('name', 'phone' , 'mail',)

    def clean_phone(self):
        code = self.data.get('code')
        phone = self.cleaned_data.get('phone')
        return '%s %s' % (code, phone)