-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

  I use the ordering in admin interface.

My sample class with GenericForeignKey

class MyClass(models.Model):
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = models.GenericForeignKey()

    def name(self):
        return self.content_object.name

    def __str__(self):
        return self.content_object.name

    class Admin:
        pass

I want user order by content_object.name or self.name()

I try :
        ordering =["name"]
and
        ordering =["content_object.name"]
but ordering search a col in table.


Have you a simple solution ?

Thx, Xavier.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJP2h4dg3EDuiPUcRAiybAJ98q3I52H6Anqt7pnG305cxTioSEACbB9JU
WCK6tVenSW2RWa6W/jiCW18=
=U4/k
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to