You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
xmrauctions/items/tasks/common.py

11 lines
343 B
Python

from datetime import timedelta
from django.utils import timezone as tz
from django.conf import settings
from items.models import Item
def get_items_past_days(days=settings.ESCROW_PERIOD_DAYS) -> list:
time_delta = tz.now() - timedelta(days=days)
items = Item.objects.filter(list_date__lt=time_delta, available=True)
return items