__author__ = 'renanalencar'

from django import forms

from .models import Agency

class AgencyForm(forms.ModelForm):
    class Meta:
        model = Agency
        fields = ["agency_id",
                  "agency_name",
                  "agency_url",
                  "agency_timezone",
                  "agency_phone",
                  "agency_lang",
                  "agency_fare_url"]

    def clean_agency_phone(self):
        agency_phone = self.cleaned_data.get('agency_phone')
        #write validation code here.
        return agency_phone

    def clean_agency_name(self):
        agency_name = self.cleaned_data.get('agency_name')
        #write validation code here.
        return agency_name
