Re: model string reprentations

2008-12-12 Thread Karen Tracey
On Fri, Dec 12, 2008 at 7:33 AM, ben852 wrote: > > Hi, > I am new to django and programming. > I have a problem with the method _str_( ). > Following the tutorial, I edited my models.py file in mysite/books and > wrote: > [snip] The fact that you are using __str__

Re: model string reprentations

2008-12-12 Thread Tim Chase
> Sure do: it should be __str__() with two underscores on either side, > not one. And for the use-case the OP gave... >> from books.models import Publisher >> publisher_list = Publisher.objects.all ( ) >> publisher_list >> >> [, ] # Python calls the __repr__ for the display at the

Re: model string reprentations

2008-12-12 Thread ben852
thanks a lot On Dec 12, 3:06 pm, Jeff FW wrote: > Sure do: it should be __str__() with two underscores on either side, > not one. > > -Jeff > > On Dec 12, 7:33 am, ben852 wrote: > > > Hi, > > I am new to django and programming. > > I have a problem

Re: model string reprentations

2008-12-12 Thread Jeff FW
Sure do: it should be __str__() with two underscores on either side, not one. -Jeff On Dec 12, 7:33 am, ben852 wrote: > Hi, > I am new to django and programming. > I have a problem with the method _str_( ). > Following the tutorial, I edited my models.py file in

model string reprentations

2008-12-12 Thread ben852
Hi, I am new to django and programming. I have a problem with the method _str_( ). Following the tutorial, I edited my models.py file in mysite/books and wrote: class Publisher(models.Model): name = models.Charfield(max_length=30) address = models.Charfield(max_length=30)