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__
> 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
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
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
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)
5 matches
Mail list logo