Hello all,

I am currently working on a push notifications library for Django 
(https://github.com/rakanalh/django-pushy). The current implementation 
provides the ability to send a push notification to all registered device 
keys (Android and iOS). 

The current use-case for the library is doing the following:

from pushy.utils import send_push_notification
send_push_notification('YOUR TITLE', 'YOUR BODY')

This would basically insert the push notification into the database and 
trigger celery to distribute *ALL device keys* into subtasks where each 
subtask sends to a certain group (0-5000, 5000-10,000 .. etc) of keys. One 
of the features i am aiming to implement for the library is the ability to 
filter the list of devices the designated push notification is to be sent 
to. So instead of having this line of code 
<https://github.com/rakanalh/django-pushy/blob/master/pushy/tasks/__init__.py#L21>,
 
which basically fetches all device keys... i would like to be able to let 
the user filter these devices.

The only option that comes to mind is to add **kwargs to 
send_push_notification so that the user can supply the device query filter 
params, which then get stored in the database to be restored in the celery 
task to filter the list of devices. I currently have no idea if this would 
work because i am thinking about the possibility of the user passing 
user=user_object or some_foreign_key=instance. That would lead me to lots 
of unnecessary query handling code. The question here is: can i turn a 
queryset into a string and restore it back into a queryset object?

Otherwise, what are my options? thoughts on this design issue are 
appreciated.

Thanks,
Rakan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/067de0f3-f282-4234-a20e-d2886fa5b7bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to