Thanks for the quick reply and it works perfectly.

Would be good if this was added to the docs on the site, I  saw this
was the way it was done in some old screencasts where they were still
calling models out of django.core and after reading the official docs
and seeing that the simplest way to call admin was class Admin: pass,
I thought the __str__ and __unicode__ method wasn't needed anymore.

Also, please don't confuse a printer with a movie. I've carried this
name for over 15 years now, on BBS and the web and as you might
imagine, the comments I've gotten since that movie came out have
gotten rather tiresome over the years.

:p

On Aug 5, 11:53 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> Hi Neo,
>
> On 8/5/07, TheMaTrIx <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I have many tables with universal data I use across projects, alot of
> > them are tables with 1 column.
>
> > One example of this is a table named "Continents" with the names of
> > all continents and subcontinents including the less known ones (like
> > the Kerguelen continent)
>
> > When I setup the admin to display the contents of these single column
> > tables, it gives me a list of:
>
> > Continents Object
> > Continents Object
> > Continents Object
> > Continents Object
>
> > instead of
>
> > Asia
> > Europe
> > North America
> > South America
>
> > Am I doing something wrong or is this some  sort of bug?
>
> > The way I call admin for these table models is simply:
>
> >         class Admin:
> >                 pass
>
> > I tried setting list_display to see if that helps, but it won't let me
> > do that when there is only 1 column in the table because list_display
> > needs a format of list_display = ('name1', 'name2', ...).
>
> Override your class' __str__ method, or better __unicode__:
>
> class Continent(models.Model):
>     ...
>     def __unicode__(self):
>         return self.name # or whatever
>
> It would be also a good idea not to create a continent class, since
> they won't change in the next future. :-)
>
> HTH
> Kai


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to