# coding=utf-8

import django_filters

from .models import Tenant,Invoice

class TenantFilter(django_filters.FilterSet):
    name = django_filters.CharFilter(field_name='name', lookup_expr='icontains')

    class Meta:
        model = Tenant
        fields = ['name',]

class InvoiceFilter(django_filters.FilterSet):
    invoice_name = django_filters.CharFilter(field_name='invoice_name', lookup_expr='icontains')
    tax_no = django_filters.CharFilter(field_name='tax_no', lookup_expr='icontains')
    consignee = django_filters.CharFilter(field_name='consignee', lookup_expr='icontains')
    consignee_tel = django_filters.CharFilter(field_name='consignee_tel', lookup_expr='icontains')

    class Meta:
        model = Invoice
        fields = '__all__'