|
|
|
@ -1,12 +1,13 @@
|
|
|
|
|
from datetime import timedelta, datetime |
|
|
|
|
from django.contrib.auth.models import User, Group |
|
|
|
|
from django.http import HttpResponseRedirect |
|
|
|
|
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME |
|
|
|
|
from django.utils.safestring import mark_safe |
|
|
|
|
from django_admin_listfilter_dropdown.filters import DropdownFilter |
|
|
|
|
from .models import Orders, Users |
|
|
|
|
|
|
|
|
|
from django.contrib import admin, messages |
|
|
|
|
from django.urls import reverse |
|
|
|
|
|
|
|
|
|
from rangefilter.filters import DateRangeFilter |
|
|
|
|
|
|
|
|
|
class OrdersAdmin(admin.ModelAdmin): |
|
|
|
|
|
|
|
|
@ -16,6 +17,18 @@ class OrdersAdmin(admin.ModelAdmin):
|
|
|
|
|
) |
|
|
|
|
actions = ['send_message'] |
|
|
|
|
exclude = ['orderAccess', 'userID', 'orderPhoto', 'orderPhotoPay'] |
|
|
|
|
search_fields = ['orderName__regex', 'orderCreateDateTime__regex', 'orderDesc__regex', |
|
|
|
|
'orderAddress__regex', 'catID__regex', 'orderStatus__regex' |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
list_filter = [ |
|
|
|
|
('orderName', DropdownFilter), |
|
|
|
|
('orderAddress', DropdownFilter), |
|
|
|
|
('orderDesc', DropdownFilter), |
|
|
|
|
('catID', DropdownFilter), |
|
|
|
|
('orderCreateDateTime', DateRangeFilter) |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def userName(self, obj): |
|
|
|
|