Re: How to get unique names for items in admin site

2008-09-26 Thread bruno desthuilliers
On 26 sep, 18:19, gv <[EMAIL PROTECTED]> wrote: > Oops - I just saw the relevant bit in the tutorial, so it is done like > this: > > class Server(models.Model): > def __unicode__(self): > return self.question The answer is 42 !-) --~--~-~--~~~---~--~---

Re: How to get unique names for items in admin site

2008-09-26 Thread Erik Allik
You might want to remove the id field as it's not needed. You also might consider converting siteid and authid to ForeignKey fields to the Model that corresponds to the table that these fkeys are referencing. So if you have Auth and Site models, you could do: site = models.ForeignKey(Site,

Re: How to get unique names for items in admin site

2008-09-26 Thread gv
Oops - I just saw the relevant bit in the tutorial, so it is done like this: class Server(models.Model): def __unicode__(self): return self.question --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

How to get unique names for items in admin site

2008-09-26 Thread gv
Hello I'm making a small app that holds data of servers in our organisation (the database existed previously, and I've created the models.py using the inspectdb as described in: http://docs.djangoproject.com/en/dev/howto/legacy-databases/ ) The admin site works OK, but each server is displayed