Hi

I have some models (Song and Author) that are related through an
intermediary model (Authorship) like this:

class Song(models.Model)
    authors = models.ManyToManyField('Author', through='Authorship')

class Author(models.Model)
    name = models.CharField(max_length=255)

class Authorship(models.Model):
        AUTHORSHIP_TYPES = (
                ('lyrics', 'Lyrics'),
                ('melody', 'Melody'),
                ('cover', 'Cover'),
        )
        author = models.ForeignKey(Author)
        song = models.ForeignKey(Song)
        authorship_type = models.CharField(choices=AUTHORSHIP_TYPES)

I have inline editing set up in the admin for Song, so that
authorships can be created/edited/deleted from the Song instance.
But now the Authors have grown to about 2500 objects, which means that
each select box contains 2500 options. This is too slow and I'm
looking for an alternative.

I have come across Django Ajax Selects: 
http://code.google.com/p/django-ajax-selects/
And Django Ajax Filtered Fields: 
http://code.google.com/p/django-ajax-filtered-fields/
(actually I'm not sure if this can be used in the django admin)

But I haven't seen anything in their documentation about support for
intermediary models like my Authorship model.

Has anyone had this problem and found a solution for it?

- Sævar

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to