User notification on checkbox

79 views Asked by At

I'm working on a Django project. It manages designers projects. Each project has a worker (who is working on the project) and a responsible (who assigns the project to a worker). The worker can modify some attributes of the project through an Update Form (and one of the project's attributes is 'complete', that is a boolean). When the worker goes to the update form and checks the 'complete' checkbox, I'd like to implement the feature of sending a notification to the projects' responsible to let him know that the project has been finished. So I'd like to send the notification not every time that the worker modifies the projects, but just when he checks the 'complete' checkbox. How should I do that?

Each project has an image field for the final result of the project, and I'd like to know if it is possible to attach it to the notification that it is sent when the workers marks that the project has been completed.

Also, as well as the notification, I'd like to send the responsible an email always with the image attached. To do that do I need to use celery or there is a simpler way that doesn't require a server? I'm sorry if the question may be stupid but I'm new to programming and English is not my first language so the documentation sometimes it's not very clear for me.

1

There are 1 answers

0
AudioBubble On

I'll give you a generic way to go about it, but your question is too broad for this forum.

  1. First you need to have a way to "notify" the user. This is a broad topic. If you want to send a notification box in real time to the responsible, then you need to dive into websockets (frontend part, backend part.
  2. If you have the notification part worked out sending an email is a breeze and you can do it in the same consumer if you want to.
  3. Attaching an image to an email comes at very little with python and Django gives you some extra facilities.
  4. You should probably not do it on checkbox click but submission of the update form (if that was your intention, then disregard).
  5. Upon submission of the update form, you can have the image uploaded so it will be available for the email. It may be wise not to allow "complete" checkbox without an image.