On 27 Jan 2011, at 13:28, Matthew Macdonald-Wallace wrote: > def save(self,*args,**kwargs): > if not self.id: > self.created = datetime.date.today() > if self.Status.ClosesChangeRequest == True: > self.completed = True > super(ChangeHeader, self).save(*args,**kwargs) > > but I assume the issue I'm running in to is that the Save handler > doesn't know the current state of the Status field. > > Is there a better approach which avoids hard-coding?
If the user had selected a valid ChangeStatus for the Status attribute on the change form; then I would expect you to be able to query the Status in the way you do above (although my situation was slightly different; so just because I would't expect something doesn't mean that is the way it is ;-)). If you run with the above code, do you get an Exception? aid -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.