m2m ordering question

2007-11-05 Thread patrickk
i´m having a model for a movie and I´d like to assign some stars using an m2m-relationship. using the admin-interface, I´m assigning stars in a specific order (the most important star first and so on). in the database, the stars are saved in the "right" order - the first one has the lowest ID and

Re: admin ordering question

2006-07-13 Thread Carlos Yoder
I solved it! The problem was because I was trying to sort by a field that was not listed on Admin.list_display Updated code: class Model(models.Model): opis= models.CharField(maxlength=50) znamka = models.ForeignKey(Znamka) def __str__(self):

Re: admin ordering question

2006-07-13 Thread Carlos Yoder
>> class Item(models.Model): > > name = models.Charfield(maxlength=100) > > user = models.ForeignKey(User) > > > > def get_user_name(self): > > return self.user.name > > > > class Admin: > > list_display = ('name', 'get_user_name') >

Re: admin ordering question

2006-06-21 Thread Adrian Holovaty
On 6/21/06, Mikeal Rogers <[EMAIL PROTECTED]> wrote: > class Item(models.Model): > name = models.Charfield(maxlength=100) > user = models.ForeignKey(User) > > def get_user_name(self): > return self.user.name > > class Admin: > list_di

admin ordering question

2006-06-21 Thread Mikeal Rogers
Hiya, Here is my issue I have a Model like this class Item(models.Model): name = models.Charfield(maxlength=100) user = models.ForeignKey(User) def get_user_name(self): return self.user.name class Admin: list_display = ('name', 'g

Ordering question

2005-09-09 Thread jocknerd
I've got two classes defined. Here's the first: class School(meta.Model): long_name = meta.CharField("Official Name", maxlength=100) nickname = meta.CharField("Mascot", maxlength=50) class META: ordering = ('long_name',) admin = meta.Admin( search_fields = ['long_na