Re: Using property() with model attributes

2008-02-11 Thread Malcolm Tredinnick
On Mon, 2008-02-11 at 06:13 -0800, shabda wrote: > I have a model something like, > > class Task(models.Model): > name = models.CharField() > parent_task = models.ForeignKey('Task') > is_complete = models.BooleanField() > > class TaskItem(models.Model) > name = models.CharField() > ta

Re: Using property() with model attributes

2008-02-11 Thread Doug B
Assuming you'll have task->subtask1->...subtaskN it seems to be that a post save signal might be useful since it can recurse easily. You might have to copy the initial value for is_complete during __init__ and then compare in post save to make sure to act only when the value has changed. --~--~

Using property() with model attributes

2008-02-11 Thread shabda
I have a model something like, class Task(models.Model): name = models.CharField() parent_task = models.ForeignKey('Task') is_complete = models.BooleanField() class TaskItem(models.Model) name = models.CharField() task = models.ForeignKey(Task) is_complete = models.BooleanField() I