Created
July 9, 2023 09:15
-
-
Save mansha99/cc41a22c3a63376385a5509cafd82482 to your computer and use it in GitHub Desktop.
project_app_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from helloapp import signals | |
class Notice(models.Model): | |
title = models.CharField(max_length=80) | |
description = models.CharField(max_length=255) | |
def save(self, *args, **kwargs): | |
if self.title=="Oops": | |
signals.invalid_notice_signal.send(sender=None) | |
return | |
else: | |
super().save(*args, **kwargs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment