Skip to content

Instantly share code, notes, and snippets.

@almet almet/
Last active Jan 13, 2019

What would you like to do?
ihatemoney stats
# IHATEMONEY_SETTINGS_FILE_PATH=/home/ihatemoney/ ./ shell
>>> # To know the number of projects with more than 10 bills and less than 3 months old.
>>> from ihatemoney.models import *; import datetime
>>> projects = [pr for pr in Project.query.all() if pr.get_bills().count() > 10 and pr.get_bills()[0].date > - datetime.timedelta(days=90)]
>>> len(projects)
>>> # To get the email of the contacts
>>> ", ".join(set([pr.contact_email for pr in projects]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.