def save(self, user, project, message, new=False): if new: me=Message( title = message.title, body = self.cleaned_data['message'], creator = user, project = project, initial_message = message, ) me.save() return me else: message.body = self.cleaned_data['message'] message.creation_date = datetime.datetime.now() message.save() return message
def save(self, user, project, message, new=False): if new: me = Message( title=message.title, body=self.cleaned_data['message'], creator=user, project=project, initial_message=message, ) me.save() return me else: message.body = self.cleaned_data['message'] message.creation_date = datetime.datetime.now() message.save() return message
def save(self, user, project, message=None): if message: #update message.title = self.cleaned_data['title'] message.body = self.cleaned_data['message'] message.tags = self.cleaned_data['tags'] message.save() return message else: #new me = Message( title=self.cleaned_data['title'], body=self.cleaned_data['message'], tags=self.cleaned_data['tags'], creator=user, project=project, ) me.save() [me.notify_to.add(user) for user in self.cleaned_data['notify']] me.initial_message = me me.save() me.read_by.add(user) return me
def save(self, user, project, message=None): if message: #update message.title = self.cleaned_data['title'] message.body = self.cleaned_data['message'] message.tags = self.cleaned_data['tags'] message.save() return message else: #new me=Message( title = self.cleaned_data['title'], body = self.cleaned_data['message'], tags = self.cleaned_data['tags'], creator = user, project = project, ) me.save() [me.notify_to.add(user) for user in self.cleaned_data['notify']] me.initial_message=me me.save() me.read_by.add(user) return me