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