Hi, I've been trying to solve one probleme, and I'll explain what I
want to do.

First I'll show my models;

class Tallaje(models.Model):
        cod = models.CharField(max_length=5)
        desc = models.CharField(max_length=60)

class Talla(models.Model):
        tallaje = models.ForeignKey('Tallaje')
        cod = models.CharField(max_length=5)
        desc = models.CharField(max_length=60)

class Articulo(models.Model):
        ref = models.CharField(max_length=15)
        tallaje = models.ForeignKey('Tallaje')

class Articulo_Talla(models.Model):
        articulo = models.ForeignKey('Articulo')
        talla = models.ForeignKey('Talla')

And my admin.py file:

class ArticuloTallaAdmin(admin.TabularInline):
        model = Articulo_Talla
        extra = 0

class ArticuloAdmin(admin.ModelAdmin):
        list_display   = ('ref',)
        list_filter    = ('ref',)
        ordering       = ('ref',)
        search_fields  = ('ref',)
        fieldsets = (
                (None, {'fields': ('ref', 'tallaje')}),
        )
        inlines = [ArticuloTallaAdmin]

I want to filter talla select from inline form by the value selected
in parent field tallaje.
Every time I change tallaje in parent, tallas in inline form must be
queryset changed.

I don't know if this can be done in admin.py or I must do it in
javascript, and I want to know where to start.

Thanks a lot.

-- 
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.

Reply via email to