[Baypiggies] Django | Clean Design Question
Glen Jarvis
glen at glenjarvis.com
Tue May 12 02:54:53 CEST 2009
>> 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.)
They are created in the models.py file.
> 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).
There, unfortunately, are set by the form field attributes (and if I
use model forms, then they come from the models).
It's all very specific to Django, unfortunately =(
Thanks, though.... :)
I hope you're doing well..
Glen
--
"You must be the change you wish to see in the world." -M. Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20090511/e0c63b27/attachment-0001.htm>
More information about the Baypiggies
mailing list