[Baypiggies] Django | Clean Design Question

Aahz aahz at pythoncraft.com
Tue May 12 02:32:19 CEST 2009

On Mon, May 11, 2009, Glen Jarvis wrote:
> Now, I have two models, we'll call model1 and model2. And, they both  
> have a name attribute. Because I normalize data, I never do something  
> like "model1.model1_name", but instead "model1.name." But, it's getting 
> me in trouble.

Where do the names "model1" and "model2" get created?  (I'm not familiar
with Django and I don't see where these names come from.)

In similar situations, what I've done in the past is made the forms use
HTML variable names such as "model1.name" and "model2.name".  I don't
know how that plays with Django and what kind of parsing you'd need to
add (if any).
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan

More information about the Baypiggies mailing list