mirror of
https://github.com/himool/HimoolERP.git
synced 2024-11-16 04:15:51 +08:00
28 lines
1 KiB
Python
28 lines
1 KiB
Python
from django_filters.rest_framework import FilterSet
|
|
from django_filters.filters import *
|
|
from apps.purchase.models import *
|
|
|
|
|
|
class PurchaseOrderFilter(FilterSet):
|
|
start_date = DateFilter(field_name='create_time', lookup_expr='gte', label='开始日期')
|
|
end_date = DateFilter(field_name='create_time', lookup_expr='lt', label='结束日期')
|
|
|
|
class Meta:
|
|
model = PurchaseOrder
|
|
fields = ['number', 'warehouse', 'supplier', 'handler', 'is_void', 'creator',
|
|
'start_date', 'end_date']
|
|
|
|
|
|
class PurchaseReturnOrderFilter(FilterSet):
|
|
start_date = DateFilter(field_name='create_time', lookup_expr='gte', label='开始日期')
|
|
end_date = DateFilter(field_name='create_time', lookup_expr='lt', label='结束日期')
|
|
|
|
class Meta:
|
|
model = PurchaseReturnOrder
|
|
fields = ['number', 'purchase_order', 'warehouse', 'supplier', 'handler',
|
|
'is_void', 'creator', 'start_date', 'end_date']
|
|
|
|
|
|
__all__ = [
|
|
'PurchaseOrderFilter', 'PurchaseReturnOrderFilter',
|
|
]
|