I'm building a site where I'm going to have 10 manufacturers and each
of those manufacturers is going to have 10 collections and each of
those collections will contain 20 style.  Confused Yet?

In my admin i have a table called styles.  It looks like this:

class Style(models.Model):
    name = models.CharField(maxlength=200)
    theslug = models.SlugField(prepopulate_from=('name',))
    manufacturer = models.ForeignKey(Manufacturer)
    collection = models.ForeignKey(Collection)
    sandp = models.ManyToManyField(Choice)

    class Admin:
        search_fields = ['name']
        list_filter = ('collection',)
        list_display = ('name', 'theslug','collection', 'rmanu')

        js = (
                '/site_media/ajax_yahoo.js',
            )

    def __str__(self,):
        return self.name

    def rmanu(self):
        return self.collection.manufacturer


We'll when I'm entering a style I want to be able to select a
manufacturer and then the collection drop-down list only shows those
collections that are tied to the manufacturer that I selected.  I'm
guessing that I'm going to need to use AJAX to accomplish this

I already have it setup to where when I'm in the admin and I'm adding
a style when I select a manufacturer a alert pops up.  So I know that
my YUI addlisteners is working.  I get confused on the part on how I
would update my collection form field with only those entries that are
tied to the manufacturer I selected.  Do I need to have a function
within my ajax.js file which call a Django view?  How would that
Django view update the contents of my collection form field?

I know these are some tough questions...but would very much appreciate
it if somebody could help me out.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to