-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major filter refactor #2736
Major filter refactor #2736
Conversation
posthog/models/filters/filter.py
Outdated
@@ -36,7 +37,207 @@ | |||
from posthog.utils import relative_date_parse | |||
|
|||
|
|||
class Filter(PropertyMixin): | |||
class DisplayMixin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fiddled with a factory pattern here but resorted to doing a more straightforward pattern for now
posthog/models/filters/filter.py
Outdated
if target_entity_data: | ||
data = json.loads(target_entity_data) | ||
return Entity({"id": data["id"], "type": data["type"]}) | ||
return None | ||
|
||
def to_dict(self) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note - we can probably automatically generate this method as well if we go the mixin route. :)
Changes
Please describe.
Checklist