would this kind of thing be 'contrib' worthy?

3 views
Skip to first unread message

Ian Holsman

unread,
Aug 3, 2006, 2:35:38 AM8/3/06
to django-d...@googlegroups.com
I've hacked the admin change list view and made it into a generic filter/listing view

the major changes:
- it's read-only, and points to the object's get_absolute_url 
- you pass it a model and a optional queryset parameter so you can restrict the 'base' 

something like:
urlpatterns += patterns( '',
    ('all/$', 'zilbo.common.filter.views.main.filter_list', {'model':Forum }),
     ('forum/$', 'zilbo.common.filter.views.main.filter_list', {'model':Forum, 'queryset':Forum.forum_objects.all()}),
     ('blog/$', 'zilbo.common.filter.views.main.filter_list', {'model':Forum, 'queryset':Forum.blog_objects.all()}),
     ('conversation/$', 'zilbo.common.filter.views.main.filter_list', {'model':Conversation }),
  )


some examples of it in action:
same model, but different queryset filtering out which rows to view

same url.py, but using the same queryset to filter by site.
- http://med-chatter.com/aggy/filter/

i personally think that this would make a nice contrib app in it's own right, but I don't want to go to a lot of effort if
the core committers are not interested in this functionality in django.

(it will probably end up being stuck in the zyons codebase in that case)

regards
Ian.

--
Ian Holsman
join http://gyspsyjobs.com the marketplace for django developers 


Adrian Holovaty

unread,
Aug 3, 2006, 9:53:28 AM8/3/06
to django-d...@googlegroups.com
On 8/3/06, Ian Holsman <kry...@gmail.com> wrote:
> I've hacked the admin change list view and made it into a generic
> filter/listing view

I'm working on something similar at the moment, which indeed be
available in "contrib." It's going to be really awesome.

But I've already said too much!

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

Ian Holsman

unread,
Aug 3, 2006, 4:34:58 PM8/3/06
to django-d...@googlegroups.com
On 03/08/2006, at 11:53 PM, Adrian Holovaty wrote:


On 8/3/06, Ian Holsman <kry...@gmail.com> wrote:
I've hacked the admin change list view and made it into a generic
filter/listing view

I'm working on something similar at the moment, which indeed be
available in "contrib." It's going to be really awesome.

sounds interesting.
do you have a timeframe?
for anyone interesting the filter, I checked it into http://svn.zyons.python-hosting.com/trunk/zilbo/common/filter/ 


But I've already said too much!

cat's out of the bad already.. spill it 
;-)

Adrian

-- 
Adrian Holovaty



--
Ian Holsman
http://med-chatter.com It's all about the medicine


oggie rob

unread,
Aug 3, 2006, 6:46:43 PM8/3/06
to Django developers
> I'm working on something similar at the moment, which indeed be available in "contrib." It's going to be really awesome.

Fantastic! I've been using the admin list views because of these
features, but it "gets a bit hacky" after a while! Wouldn't have
thought it necessary in contrib (instead just in forms, if it is
generic), but same difference. I can hardly wait.

-rob

Reply all
Reply to author
Forward
0 new messages