My views
from django.shortcuts import render def auto_notification(request): return render (request, "user/dashboard.html")My models
from django.db import models from django.contrib.auth.models import User#articles model
class Articles(models.Model):
title = models.CharField(max_length=300) date= models.DateField() author=models.ForeignKey(User, on_delete=models.CASCADE) body=models.TextField()def __str__(self) -> str:
return self.title#games model
GAME_TYPE=( ("action", "action"), ("adventure", "adventure"), ("racing", "racing"), ("puzzle", "puzzle"), )
MOV_TYPE=( ("action", "action"), ("adventure", "adventure"), ("sci-fi", "sci-fi"), ("horror", "horror"), ("drama", "drama"), )
GAME_OS=( ("Windows", "Windows"), ("Android", "Android"), )
class Games(models.Model): name=models.CharField(max_length=50) type=models.CharField(max_length=40, choices=GAME_TYPE) os=models.CharField(max_length=15, choices=GAME_OS) img=models.ImageField() developer=models.CharField(max_length=50) version=models.CharField(max_length=10) ratings=models.CharField(max_length=10) description=models.TextField()
def __str__(self) -> str:
return self.name classMovies(models.Model): name=models.CharField(max_length=50) type=models.CharField(max_length=40, choices=MOV_TYPE) description=models.TextField() released=models.DateField()
def __str__(self) -> str:
return self.nameI have three models below, but l like to create a Notification System to send a message to a User whenever ;
1. An object is created in all those models
2. An object is modified in all those modelsAnd l would like to add trick that it sends the Notification Message after 15 minutes of publiction or creation.
And I would like to pass the following data if available in the object ;
1. the Name of the Object,
2. the Image of the Object, and
3. the type of the Object.Lastly I would like to add a :
1. Notification DELETE function, that gives User a way to delete that Message , not to appear in his or notification section again.2. Mark as Read function, that changes the Massage Div Color
3. A notification Barge that displays the UNREAD Messages.
Am requesting anyone to help me Because Am stuck , I have no where to Start from. I will be on waiting your guidelines.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGQoQ3wRpg%2BcT69wqUbapHbK7KSEfwU%2BxfJ-EKRCcddY6KwtnA%40mail.gmail.com.
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCdBb5kP_eF4_CK4F%2B3ibP_PvmgJetrGJs4a7PBZfxSYGg%40mail.gmail.com.