Skip to content
Snippets Groups Projects
Verified Commit 4a46eeb8 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add post_save signal to attach notes to new timeslots

Closes # 214
parent 7f770ad0
No related branches found
No related tags found
No related merge requests found
from django.apps import AppConfig
class ProgramConfig(AppConfig):
name = "program"
def ready(self):
import program.signals # noqa
from django.db.models.signals import post_save
from django.dispatch import receiver
from program.models import Note, TimeSlot
@receiver(post_save, sender=TimeSlot)
def attach_note(sender, instance, created, **kwargs):
if created:
Note.objects.create(timeslot=instance)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment