#3400: [patch] Support for lookup separator with list_filter admin option
---------------------------------------+------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Admin interface | Version: newforms-admin
Resolution: | Keywords: nfa-someday
list_filter FilterSpec nfa-changelist ep2008
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
---------------------------------------+------------------------------------
Comment (by anonymous):
Just wrote small app for testing this. I don't want to write tests.
models.py:
{{{
from django.conf import settings
from django.db import models
from django.contrib import admin
class Town(models.Model):
name = models.CharField(max_length=64)
def __unicode__(self):
return self.name
class House(models.Model):
town = models.ForeignKey(Town)
def __unicode__(self):
return self.town.name
class Room(models.Model):
house = models.ForeignKey(House)
def __unicode__(self):
return self.house.town.name
class Booking(models.Model):
room = models.ForeignKey(Room)
def __unicode__(self):
return self.room.house.town.name
class BookingOpts(admin.ModelAdmin):
list_filter = ('room__house__town',)
raw_id_admin = ('room', )
admin.site.register(Town)
admin.site.register(House)
admin.site.register(Room)
admin.site.register(Booking, BookingOpts)
}}}
Works fine.
--
Ticket URL: <http://code.djangoproject.com/ticket/3400#comment:13>
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
-~----------~----~----~----~------~----~------~--~---