Django: how to execute code ONLY after the first time a M2M relationship is added?
问题 I'm trying to get create_reminder_send_message() executed THE FIRST TIME the Reminder object is saved AND the Reminder.users is saved. The code as it is executes every time I update the object... what am I missing? How can I accomplish what I want? class Reminder(models.Model): METHODS = ( ('EM', 'Send Email'), ('TS', 'Create Dashboard Task'), ('ET', 'Both (recommended)') ) info = models.TextField() method = models.CharField(max_length=3, choices=METHODS, db_index=True, help_text='''How