Kevin Dangoor wrote:
On 10/26/05, Todd Greenwood <[EMAIL PROTECTED]> wrote:
Great, thanks Kevin. I'll put this in my next tutorial extension.
Somehow this escaped me in the docs. The django has an OR mapping more
like what I was expecting...
Which is?
I'm all for API improvements that make things easier. I haven't
studied Django's OR mapper in enough detail to know where it's better
or easier, so it's good to hear from people who've actually used both.
In this particular case, it may actually be confusing to have an
addEntry method. Consider this:
p1 = Page(..)
p2 = Page(..)
e = Entry(page=p1)
p2.addEntry(e)
So, what happens there? Does e's page change to p2?
Since you *have* to specify a page when creating an Entry, the
relationship is dealt with.
Kevin
I've been giving this some thought for other reasons, and I'd think
addEntry would be a thin veneer on Entry() that automatically sets page
to the current page's id. That would clear up the uncertainty above, but
doesn't buy much other than a slightly clearer syntax.
P