On Mon, Sep 15, 2008 at 8:20 AM, Donn <[EMAIL PROTECTED]> wrote:

>
> Hi,
> Thought I'd start a new thread to clear out the cruft.
>
> http://dpaste.com/78151/ shows my latest shot at the thing.
>
> In that dpaste, the Client->WebsiteInline works as I'd hoped. But the
> Website->PluginsEnabled does not.
>
> I include my reasoning in comments in the dpaste.
>
> If anyone can take a moment to put me out of my misery - please do. I
> confess
> that relationships between models is not my strong point and I am hoping to
> learn from a solution.
>
> While the code seems to work, I'd like to know what I should be doing to
> make
> it really work. :)
>

With the new models you still have "should be the same" client duplicated in
two places, which was the thing I was trying to advise you to get rid of.
PluginsEnabled has a 'client' ForeignKey and a Website ForeignKey...but
Website also has a 'client' ForeignKey and from what you've said these two
'client' values should always be the same. Therefore PluginsEnabled should
not have a 'client' ForeignKey. Any code working with a PluginsEnabled
instance that needs to use the 'client' value can get it by accessing the
'client' field of the PluginsEnabled 'website'  ForeignKey. 'client' does
not need to be directly kept in the PluginsEnabled model, since it is
accessible from the Website model.

(The original dpaste seems to be gone so I can't compare before-and-after
which would have maybe allowed me to be more helpful.  From what I recall,
though, of the original models, my sense is you have just moved the original
problem from one model to another.  Going back to the original models and
just removing the original 'client' duplication may be the best course; I am
not sure what benefit the changes you have made are providing given that
they did not remove this duplication.)

Karen

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to