from posthog.models import Filter filter = Filter(data={ "properties": [{ "key": "username", "operator": "exact", "value": "johndoe" }] })
from posthog.models import Filter from datetime import datetime, timedelta start_date = datetime.now() - timedelta(days=7) end_date = datetime.now() filter = Filter(data={ "date_from": start_date, "date_to": end_date, })This code creates a filter object that filters events that occurred within the last 7 days. Overall, the Filter model in PostHog provides a flexible way to filter events and properties, allowing for more targeted analysis and insights.