#5587: Sorting by ForeignKey
---------------------------+------------------------------------------------
Reporter: anonymous | Owner: nobody
Status: new | Component: Uncategorized
Version: newforms-admin | Keywords:
Stage: Unreviewed | Has_patch: 0
---------------------------+------------------------------------------------
Hi,
I'm using newforms-admin r6399 and don't understand how sorting by
ForeignKey works in the admin site.
consider this:
{{{
class Box(models.Model):
serial = models.CharField(max_length=25, primary_key=True)
group = models.ForeignKey(Group)
force_fw = models.ForeignKey(release.Firmware,
related_name='force_fw', blank=True, null=True)
blocked = models.BooleanField(default=False)
reported_fw = models.ForeignKey(release.Firmware,
related_name='reported_fw', blank=True, null=True)
reported_time = models.DateTimeField(blank=True, null=True)
reported_ip = models.IPAddressField(blank=True, null=True,
default=None)
}}}
If i set force_fw to "blank=True, null=True" (optional field to store
as NULL if not given), i cannot sort by this field in the admin page.
If i set it to "blank=True" the admin page only shows entries with a
non-null force_fw.
Any idea?
--
Ticket URL: <http://code.djangoproject.com/ticket/5587>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---