def table_created(sender, table, user, **kwargs): transaction.on_commit(lambda: broadcast_to_group.delay( table.database.group_id, { "type": "table_created", "table": TableSerializer(table).data }, getattr(user, "web_socket_id", None), ))
def table_created(sender, table, user, **kwargs): transaction.on_commit(lambda: broadcast_to_group.delay( table.database.group_id, { 'type': 'table_created', 'table': TableSerializer(table).data }, getattr(user, 'web_socket_id', None) ))
def tables_reordered(sender, database, order, user, **kwargs): transaction.on_commit(lambda: broadcast_to_group.delay( database.group_id, { "type": "tables_reordered", "database_id": database.id, "order": order, }, getattr(user, "web_socket_id", None), ))
def table_deleted(sender, table_id, table, user, **kwargs): transaction.on_commit(lambda: broadcast_to_group.delay( table.database.group_id, { "type": "table_deleted", "database_id": table.database_id, "table_id": table_id, }, getattr(user, "web_socket_id", None), ))
def table_deleted(sender, table_id, table, user, **kwargs): transaction.on_commit(lambda: broadcast_to_group.delay( table.database.group_id, { 'type': 'table_deleted', 'database_id': table.database_id, 'table_id': table_id }, getattr(user, 'web_socket_id', None) ))