# coding=utf-8

import django_filters

from .models import ProductOrder


class ProductOrderFilter(django_filters.FilterSet):
    customer_name = django_filters.CharFilter(field_name='customer_address__name', lookup_expr='icontains')
    product_name = django_filters.CharFilter(field_name='product__name', lookup_expr='icontains')
    tel = django_filters.CharFilter(field_name='customer_address__tel', lookup_expr='icontains')
    status = django_filters.CharFilter(field_name='status')

    class Meta:
        model = ProductOrder
        fields = '__all__'
