Re: Advice on many to many with too many records in admin

2009-02-14 Thread Malcolm Tredinnick

On Sat, 2009-02-14 at 11:28 -0800, Rob Hudson wrote:
> Hi Django Users,
> 
> I'm setting up a new Django model for a Newsletter app.  The
> newsletter model has a many to many to a Book model that has about
> 20,000 records.  This results in a multiple select box that is
> unusable for searching/selecting books.
> 
> I have some ideas on what I can do to make this usable but I also
> wanted to see if anyone else has had this problem and what they did to
> work around it.
> 
> Some ideas with what I imagine are their pros/cons...
> 
> 1) Instead of using a many to many, use a text field that the user
> enters a comma separated list of items as lookup strings for the Book
> model.  Pros: Pretty simple to do.  Cons: Opens up potentially lots of
> user error by having to type exact strings for the model lookup.
> 
> 2) Override the admin views and templates for adding and editing
> Newsletters and use a different widget for selecting books.  The
> widget could be an AJAX auto complete multiple widget of some sort, as
> seen on a lot of sites.  Pros: Easier for the user to enter multiple
> books using a common web pattern.  Cons: I'd say quite a bit more time
> consuming to set up.

I'd go with he AJAX widget if you're after maximum usability (and can
afford the Javascript dependency). It's not going to be that painful to
set up. It's the equivalent of live-search functionality and there are a
lot of examples of doing that with AJAX around on the Internet.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Advice on many to many with too many records in admin

2009-02-14 Thread Alex Gaynor
On Sat, Feb 14, 2009 at 2:44 PM, Rob Hudson  wrote:

>
> On Sat, Feb 14, 2009 at 11:29 AM, Alex Gaynor 
> wrote:
> > Have you tried using raw_id_fields with it?
> > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#raw-id-fields
>
> Just now tested that out.  That works pretty well but the downside is
> that, for the user, the ID means nothing.  It has the lookup button to
> pick a book, but once selected, it's difficult to review that
> everything looks correct before saving.
>
> It does solve the too many records to search through problem, but
> usability is lacking, IMO.
>
> Thanks for the suggestion... I think I'll use it for now and see if
> anyone else responds.
>
> -Rob
>
> >
>
You might try messaging Jannis Leidel on freenode then, I know he's been
working on a ManyToMany ajax lookup field to complement his foreign key one:
http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Advice on many to many with too many records in admin

2009-02-14 Thread Rob Hudson

On Sat, Feb 14, 2009 at 11:29 AM, Alex Gaynor  wrote:
> Have you tried using raw_id_fields with it?
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#raw-id-fields

Just now tested that out.  That works pretty well but the downside is
that, for the user, the ID means nothing.  It has the lookup button to
pick a book, but once selected, it's difficult to review that
everything looks correct before saving.

It does solve the too many records to search through problem, but
usability is lacking, IMO.

Thanks for the suggestion... I think I'll use it for now and see if
anyone else responds.

-Rob

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Advice on many to many with too many records in admin

2009-02-14 Thread Alex Gaynor
On Sat, Feb 14, 2009 at 2:28 PM, Rob Hudson  wrote:

>
> Hi Django Users,
>
> I'm setting up a new Django model for a Newsletter app.  The
> newsletter model has a many to many to a Book model that has about
> 20,000 records.  This results in a multiple select box that is
> unusable for searching/selecting books.
>
> I have some ideas on what I can do to make this usable but I also
> wanted to see if anyone else has had this problem and what they did to
> work around it.
>
> Some ideas with what I imagine are their pros/cons...
>
> 1) Instead of using a many to many, use a text field that the user
> enters a comma separated list of items as lookup strings for the Book
> model.  Pros: Pretty simple to do.  Cons: Opens up potentially lots of
> user error by having to type exact strings for the model lookup.
>
> 2) Override the admin views and templates for adding and editing
> Newsletters and use a different widget for selecting books.  The
> widget could be an AJAX auto complete multiple widget of some sort, as
> seen on a lot of sites.  Pros: Easier for the user to enter multiple
> books using a common web pattern.  Cons: I'd say quite a bit more time
> consuming to set up.
>
> Any other ways to do this?  Or some examples of #2 to help someone
> along?
>
> Thanks,
> Rob
> >
>
Have you tried using raw_id_fields with it?
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#raw-id-fields

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Advice on many to many with too many records in admin

2009-02-14 Thread Rob Hudson

Hi Django Users,

I'm setting up a new Django model for a Newsletter app.  The
newsletter model has a many to many to a Book model that has about
20,000 records.  This results in a multiple select box that is
unusable for searching/selecting books.

I have some ideas on what I can do to make this usable but I also
wanted to see if anyone else has had this problem and what they did to
work around it.

Some ideas with what I imagine are their pros/cons...

1) Instead of using a many to many, use a text field that the user
enters a comma separated list of items as lookup strings for the Book
model.  Pros: Pretty simple to do.  Cons: Opens up potentially lots of
user error by having to type exact strings for the model lookup.

2) Override the admin views and templates for adding and editing
Newsletters and use a different widget for selecting books.  The
widget could be an AJAX auto complete multiple widget of some sort, as
seen on a lot of sites.  Pros: Easier for the user to enter multiple
books using a common web pattern.  Cons: I'd say quite a bit more time
consuming to set up.

Any other ways to do this?  Or some examples of #2 to help someone
along?

Thanks,
Rob
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---