def save(self, author, commit): instance = super(CommuniqueForm, self).save(commit=False) instance.author = author instance.save(author) mail_format(instance.receiver, instance.receiver.name, instance.author, 'New Communique', instance.content, noun="communique", verb="sent") return instance
def save(self, *args, **kwargs): mail_format(self.to_storyobject, self.to_storyobject.name, self.from_storyobject.creator, 'New Relationship', self, noun="relationship", verb="added") super(Relationship, self).save(*args, **kwargs)
def save(self, commit=False, *args, **kwargs): instance = super(NoteForm, self).save(commit=False) try: instance.creator = kwargs.pop('creator') except KeyError: instance.creator = None try: instance.storyobject = kwargs.pop('storyobject') mail_format(instance.storyobject, instance.storyobject.name, instance.creator, instance.title, instance.content) except KeyError: pass try: instance.scene = kwargs.pop('scene') mail_format(instance.scene, instance.scene.title, instance.creator, instance.title, instance.content) except KeyError: pass try: instance.place = kwargs.pop('place') mail_format(instance.place, instance.place.name, instance.creator, instance.title, instance.content) except KeyError: pass try: instance.chapter = kwargs.pop('chapter') mail_format(instance.chapter, instance.chapter.title, instance.creator, instance.title, instance.content) except KeyError: pass try: instance.story = kwargs.pop('story') mail_format(instance.story, instance.story.title, instance.creator, instance.title, instance.content) except KeyError: pass instance.save() return instance