views:

29

answers:

1

Hi all,

Our product model can have multiple campaigns. Our customers change these campaigns frequently and generally on multiple products. So what we need right now seems that we need to show a multiple select widget on a change-list of Product model where our customers can easily change the campaigns.

Any idea on this? Maybe another way to achieve this kind of UI interaction?

Thanks,

A: 

say you have a product model


class Product(models.Model):
  name=models.CharField(max_length=20)
  cost=models.DecimalField(max_length=10)



you can subclass the admin's Modeladmin to show a list display for the products or you can do a custom modelform for the product which you can call in the product's admin


from django.contrib import admin
from django import forms

class PropertyInline(admin.TabularInine):
   model=Property
   extra=1

class PropertyForm(admin.ModelAdmin):
   inlines=(PropertyInline,)







mossplix
As I stated in the question, what I want to achieve is to chnage the change-list for the model. Inlining will customize the product add/edit page.
SumerCip