In my project, I have this class:
class Centre(models.Model):
[...]
tipus = models.CharField(maxlength=14, choices=TIPUS_CENTRE,
verbose_name="Tipus de centre", default='IES')
nom = models.CharField(maxlength=100, verbose_name="Nom del centre")
[...]
def __str__(self):
return "%s" % self.nom
class Meta:
ordering = ('tipus', 'nom')
class Admin:
pass
list_display = ('nom', 'codi', 'tipus', 'localitat',
'ordre_concurs', 'cp', 'adreca')
Although ordering is ('tipus', 'nom'), django admin interface displays
the Centre objects by 'tipus' but randomly (?) with 'nom'. I don't
know how can I do, because, in shell when I put
> Centre.objects.order_by('tipus', 'nom')
it displays me correctly
So, is it possible bug in 0.96?
Please, if you need my database records, I could pass you in private
communication ("big" database)
Thanks in advance,
Xan.
Please read the Django documentation:
http://www.djangoproject.com/documentation/model-api/#ordering
> So, is it possible bug in 0.96?
No, read the documentation and it will tell you exactly what you're seeing.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
On Sep 30, 11:22 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> On 9/30/07, Xan <xancor...@gmail.com> wrote:
>
> > Although ordering is ('tipus', 'nom'), django admin interface displays
> > the Centre objects by 'tipus' but randomly (?) with 'nom'. I don't
> > know how can I do, because, in shell when I put
> > > Centre.objects.order_by('tipus', 'nom')
>
> Please read the Django documentation:
>
> http://www.djangoproject.com/documentation/model-api/#ordering
>
> > So, is it possible bug in 0.96?
>
> No, read the documentation and it will tell you exactly what you're seeing.
Oh! yes.
But, is it a bug so?
Thanks,
Xan.
>
>
>
> On Sep 30, 11:22 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> > On 9/30/07, Xan <xancor...@gmail.com> wrote:
> >
> > > Although ordering is ('tipus', 'nom'), django admin interface displays
> > > the Centre objects by 'tipus' but randomly (?) with 'nom'. I don't
> > > know how can I do, because, in shell when I put
> > > > Centre.objects.order_by('tipus', 'nom')
> >
> > Please read the Django documentation:
> >
> > http://www.djangoproject.com/documentation/model-api/#ordering
> >
> > > So, is it possible bug in 0.96?
> >
> > No, read the documentation and it will tell you exactly what you're seeing.
>
> Oh! yes.
>
> But, is it a bug so?
If it is in the documentation, it is intended behaviour.
Please, direct questions about the useage of Django to django-users, and not
django-developers, which is for developing the Django framework itself. And
that does include bugs unless you're pretty sure that this is a core issue
for Django developers. Which is extremely seldom the case.
Michael
--
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The IT-Outsourcing Company
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk -
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689
Thanks,
Xan.
On Oct 2, 9:39 am, Michael Radziej <m...@noris.de> wrote:
> On Mon, Oct 01, Xan wrote:
>
> > On Sep 30, 11:22 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> > > On 9/30/07, Xan <xancor...@gmail.com> wrote:
>
> > > > Although ordering is ('tipus', 'nom'), django admin interface displays
> > > > the Centre objects by 'tipus' but randomly (?) with 'nom'. I don't
> > > > know how can I do, because, in shell when I put
> > > > > Centre.objects.order_by('tipus', 'nom')
>
> > > Please read the Django documentation:
>
> > >http://www.djangoproject.com/documentation/model-api/#ordering
>
> > > > So, is it possible bug in 0.96?
>
> > > No, read the documentation and it will tell you exactly what you're seeing.
>
> > Oh! yes.
>
> > But, is it a bug so?
>
> If it is in the documentation, it is intended behaviour.
>
> Please, direct questions about the useage of Django to django-users, and not
> django-developers, which is for developing the Django framework itself. And
> that does include bugs unless you're pretty sure that this is a core issue
> for Django developers. Which is extremely seldom the case.
>
> Michael
>
> --
> noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
> Tel +49-911-9352-0 - Fax +49-911-9352-100http://www.noris.de- The IT-Outsourcing Company
Thanks,
Xan.
On Oct 2, 9:39 am, Michael Radziej <m...@noris.de> wrote:
> On Mon, Oct 01, Xan wrote:
>
> > On Sep 30, 11:22 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> > > On 9/30/07, Xan <xancor...@gmail.com> wrote:
>
> > > > Although ordering is ('tipus', 'nom'), django admin interface displays
> > > > the Centre objects by 'tipus' but randomly (?) with 'nom'. I don't
> > > > know how can I do, because, in shell when I put
> > > > > Centre.objects.order_by('tipus', 'nom')
>
> > > Please read the Django documentation:
>
> > >http://www.djangoproject.com/documentation/model-api/#ordering
>
> > > > So, is it possible bug in 0.96?
>
> > > No, read the documentation and it will tell you exactly what you're seeing.
>
> > Oh! yes.
>
> > But, is it a bug so?
>
> If it is in the documentation, it is intended behaviour.
>
> Please, direct questions about the useage of Django to django-users, and not
> django-developers, which is for developing the Django framework itself. And
> that does include bugs unless you're pretty sure that this is a core issue
> for Django developers. Which is extremely seldom the case.
>
> Michael
>
> --
> noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
> Tel +49-911-9352-0 - Fax +49-911-9352-100http://www.noris.de- The IT-Outsourcing Company
A "bug" is when software does not behave the way it is supposed to.
The software is supposed to behave this way. Therefore, this is not a
bug.
If you think that it would be a good *enhancement* to add support for
multi-column ordering, that's another issue entirely, but software
behaving as document is not and can not be a "bug".
In terms of the UI, I think it's fairly safe to only indicate the
primary column we're sorting by and it's direction as we do now -
sorting by a secondary column without any indication couldn't possibly
be more confusing or cause any breakage when compared to the current
random secondary sorting, and fits with most desktop app UIs.
Those who never even give a second thought to multi-column sorting can
safely continue not knowing that it exists, while others who want it,
or are familiar with it from desktop apps, or simply find it intuitive
to have the current sort maintained as a secondary sort when selecting
a new primary sort, can reap the rewards.
Tai.
Thanks a lot,
Xan.