You can always pre-define them all in a dict:
cat2form = {'TV': TVForm, 'Laptop': LaptopForm}
model_form = cat2form[category]
model_form_instance = model_form()
This way you forms don't have to follow a strict naming convention.
--
Michael
On Sun, 2010-10-03 at 01:04
On 10/3/2010 4:04 AM, Andy wrote:
> I need to model many different product categories such as TV, laptops,
> women's apparel, men's shoes, etc.
>
> Since different product categories have different product attributes,
> each category has its own separate Model: TV, Laptop, WomensApparel,
>
I need to model many different product categories such as TV, laptops,
women's apparel, men's shoes, etc.
Since different product categories have different product attributes,
each category has its own separate Model: TV, Laptop, WomensApparel,
MensShoes, etc.
And for each Model I created a
3 matches
Mail list logo