-
Notifications
You must be signed in to change notification settings - Fork 62
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
Create a subscription via model fields #34
Comments
Hi All, |
Ok, ain't perfect, but here is a specific implementation of that feature, for all object you want to subscribe from, register throw a sub_field model called "company". But it's working for my use case. notification/bindings.py
routing.py
|
I'm looking for this feature too. After searching a lot, no success, I'm trying override the subscriber method because I'm creating a chat, so the user just can receiver messages that was send to him. Do you have any ideias how to apply this filter? |
Hi there,
Currently, the subscriptions only allow subscriptions for any resource, or a specific resource by it's PK. Is it possible to implement functionally to subscribe to a set of resources that fulfil some criteria, other than PK.
For example, we might have a field called name, and we may want to subscribe to any creations in which the name == "John". The current work around is to subscribe for all creations, and then filter the stream client side.
Just an example of how this could be done
{
"stream": "people",
"payload": {
"action":"subscribe",
"data": {
"action": "create"
}
"filter":{
"name": "John"
}
}
It would probably also make sense to move the existing PK field to the new filter dict.
This is obviously a big design change, but I personally feel that keeping as much of the processing on the server side is better than the current workaround.
The text was updated successfully, but these errors were encountered: