Re: Sort by foreignkey values

2009-01-05 Thread Patrick
On 5 jan, 01:38, Daniel Roseman wrote: > On Jan 4, 11:24 pm, Malcolm Tredinnick > wrote: > > > > > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: > > > [...] > > > > I don't know why you say filtering Equipamento based on the

Re: Sort by foreignkey values

2009-01-04 Thread Patrick
On 5 jan, 01:38, Daniel Roseman wrote: > On Jan 4, 11:24 pm, Malcolm Tredinnick > wrote: > > > > > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: > > > [...] > > > > I don't know why you say filtering Equipamento based on the

Re: Sort by foreignkey values

2009-01-04 Thread Daniel Roseman
On Jan 4, 11:24 pm, Malcolm Tredinnick wrote: > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: > > [...] > > > I don't know why you say filtering Equipamento based on the value in > > Model 'seems to be not possible'. On the contrary, it is perfectly > >

Re: Sort by foreignkey values

2009-01-04 Thread Malcolm Tredinnick
On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: [...] > I don't know why you say filtering Equipamento based on the value in > Model 'seems to be not possible'. On the contrary, it is perfectly > possible - that's the whole point of a relational database system. You > want something

Re: Sort by foreignkey values

2009-01-04 Thread Daniel Roseman
On Jan 4, 8:30 pm, Patrick wrote: > Ok, I will rephrase that with a concrete example: > I have those to models: > > class Modelo(models.Model): >     nome = models.CharField(max_length=10) >     manageable = models.BooleanField() > > class Equipamento(models.Model): >    

Re: Sort by foreignkey values

2009-01-04 Thread garagefan
http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries i would use .filter and .order_by On Jan 4, 8:30 pm, Patrick wrote: > Ok, I will rephrase that with a concrete example: > I have those to models: > > class Modelo(models.Model): >     nome =

Re: Sort by foreignkey values

2009-01-04 Thread Patrick
Ok, I will rephrase that with a concrete example: I have those to models: class Modelo(models.Model): nome = models.CharField(max_length=10) manageable = models.BooleanField() class Equipamento(models.Model): modelo = models.ForeignKey(Modelo) nome =

Sort by foreignkey values

2009-01-04 Thread Patrick
Hello everybody. Let's say i have the models Model1 and Model2. Model1 has a BooleanField called Personalizabe. Model2 has a field named 'model1' that is a ForeignKey to Model1. Is there a way, through the admin page, to filter all the Model2 objects according to this Personalizable attribute?