def get_objects(self, request): u = CustomUser.objects.get(pk=request.user.id) if (u.is_superuser): objects = Order.objects.filter().order_by('-created_at') else: objects = Order.objects.filter(owner=u).order_by('-created_at') obj = custom_filter(objects, request) return obj
def get_objects(self, request): objects = Category.objects.all().order_by('-created_at') obj = custom_filter(objects, request) return obj
def get_objects(self, request): objects = Product.objects.order_by('-times_bought')[:8] obj = custom_filter(objects, request) return obj
def get_objects(self, request): from datetime import datetime, timedelta last_month = datetime.today() - timedelta(days=30) objects = Product.objects.filter(created_at__gte=last_month).order_by('-created_at') obj = custom_filter(objects, request) return obj
def get_objects(self, request): objects = Product.objects.filter(offer=True).order_by('-created_at') obj = custom_filter(objects, request) return obj
def get_objects(self, request): objects = ProductImage.objects.all().order_by('-created_at') obj = custom_filter(objects, request) return obj
def get_objects(self, request): objects = CustomUser.objects.all() obj = custom_filter(objects, request) return obj