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
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):
>> 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')
>
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
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
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
6 matches
Mail list logo