But the admin page to view and add companies shows the current list of companies with the label "Company object" instead of the names that I gave to those registers. The same happens with the other classes of my model.
Lachlan Musicman
unread,
Nov 24, 2012, 10:34:21 PM11/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I don't think you want unicode, I think you want:
class Meta:
verbose_name="Company"
verbose_name_plural = "Companies"
--
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
That doesn't solve the problem I stated. I still will be seeing a bounch of "Company Object" for every company that I register on the database.
I the image https://docs.djangoproject.com/en/dev/_images/admin04t.png from the tutorial, part 2, we can see how the poll objects are listed by using the result of __unicode__() function. (That's what one understands by reading the tutorial)
Anton Baklanov
unread,
Nov 26, 2012, 11:37:35 AM11/26/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
No need for that. I've reproduced your problem. With python 3 __unicode__ method is ignored.
We should search for corresponding ticket on trac, or create new one.
On Mon, Nov 26, 2012 at 6:31 PM, Anton Baklanov <antonb...@gmail.com> wrote:
Hi. I've just checked - it uses __unicode__() to display object names.
Please show us your full admin.py and models.py
--
Regards,
Anton Baklanov
--
Regards,
Anton Baklanov
ajendrex
unread,
Nov 26, 2012, 11:56:01 AM11/26/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Yes, I'm using python 3. I think there is no ticket for this yet, but I would prefer someone with better english and more time using django posted it.
Anton Baklanov
unread,
Nov 26, 2012, 12:10:24 PM11/26/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
__str__ method works fine with python 3.
i will continue searching the truth here and will create ticket (if it will be required after finding truth)
thanks
Javier Guerra Giraldez
unread,
Nov 26, 2012, 5:35:19 PM11/26/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
On Mon, Nov 26, 2012 at 12:10 PM, Anton Baklanov
<antonb...@gmail.com> wrote:
> __str__ method works fine with python 3.
that's how it's supposed to be according to the six library. kinda
makes sense, since in Py3 all strings are unicode
--
Javier
Anton Baklanov
unread,
Nov 26, 2012, 11:31:05 AM11/26/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Anton Baklanov
unread,
Nov 27, 2012, 7:22:52 AM11/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message