Re: Having a instance of a model object instantiate another

2008-05-25 Thread Diego Ucha
John, If you don't have to fill any of Checkbox's fields (attended, was_drunk, silly_walk, naughty or been_seen), then i don't think you have to create an instance of it bounded with an Event. Create it when you have one of these fields. This way if you want to get a real statistic of how many Ch

Re: Having a instance of a model object instantiate another

2008-04-25 Thread jrmorrisnc
So, I have it doing what I want now: class Event(models.Model): date = models.DateTimeField() description = models.TextField() def __init__(self, *args, **kwargs): models.Model.__init__(self, *args, **kwargs) self.checklist = CheckList(se

Re: Having a instance of a model object instantiate another

2008-04-24 Thread jrmorrisnc
So, after re-reading the related_name / related_objects documentation I've dealt with my lack of understand on properly getting __str__ method to return what I want, I thnk. And the other part, creating an instance of CheckList whenever an Event is created should be easy, too. Just wasn't lookin

Having a instance of a model object instantiate another

2008-04-24 Thread John Morris
Hi, I have the following: class Event(models.Model): date = models.DateTimeField() description = models.TextField() def __str__(self): return self.date class Admin:pass class CheckList(models.Model): name = models.CharField(max_length=32)