Skip to content

Get recent logins but no signed contract

Rasmus Rudling edited this page Nov 10, 2021 · 1 revision
import datetime

from companies.models import SignupLog

signup_logs = SignupLog.objects.filter()

for signup_log in signup_logs:
    start_date = datetime.datetime(2021, 6, 4, 0, 0)
    end_date = datetime.datetime(2021, 6, 22, 23, 59)
    timestamp = signup_log.timestamp
    if start_date < timestamp and timestamp < end_date:
        print()
        print(f"--- {signup_log.company} ---")
        print(signup_log.company_contact)
        print(timestamp)
        print("---")
Clone this wiki locally