Skip to content

Conversation

knokko
Copy link

@knokko knokko commented Sep 15, 2025

This PR makes it very easy to automatically push websocket updates upon saving or deleting models:

class Example(BinderModel):
    push_websocket_updates_upon_save = True

@knokko knokko force-pushed the T50470-simplify-websockets branch 2 times, most recently from fbbb519 to fd5c56b Compare September 15, 2025 09:51
@knokko knokko marked this pull request as ready for review September 15, 2025 10:22
@knokko knokko marked this pull request as draft September 15, 2025 11:37
@knokko knokko force-pushed the T50470-simplify-websockets branch from fd5c56b to 4d3eab9 Compare September 15, 2025 12:18
@knokko knokko marked this pull request as ready for review September 15, 2025 12:28
@knokko
Copy link
Author

knokko commented Sep 16, 2025

I should look into also sending websocket updates upon bulk update/create/delete

edit: done

@knokko knokko force-pushed the T50470-simplify-websockets branch from 4d3eab9 to 9bae7ea Compare September 18, 2025 12:02
@knokko knokko marked this pull request as draft September 18, 2025 12:16
@knokko knokko force-pushed the T50470-simplify-websockets branch from 9bae7ea to 732ac4e Compare September 18, 2025 12:28
@knokko knokko marked this pull request as ready for review September 18, 2025 12:33
@knokko knokko marked this pull request as draft September 18, 2025 12:48
@knokko knokko force-pushed the T50470-simplify-websockets branch 2 times, most recently from bfaa447 to af85062 Compare September 18, 2025 13:07
binder/models.py Outdated
abstract = True
ordering = ['pk']

def push_default_websocket_update(self):
Copy link

@viliamDokov viliamDokov Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a @classmethod It only uses self to access a class variable and the class name, no instance needed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better?

@knokko knokko force-pushed the T50470-simplify-websockets branch from af85062 to d926e02 Compare September 18, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants