Saturday, July 7, 2012

Re: migration via south for inheritance change -> please help

Thanks guys for this helpfull discussion

2012/7/5 Tomas Neme <lacrymology@gmail.com>:
> [...] I assumed
> he maybe doesn't know about abstract models because he said he's just
> getting started programming (or at least on py/dj) and maybe he wasn't
> sure what behavior he needed, and what were his options.

...although I was aware of the concept of abstract classes and
abstract models, I just did not come up with the idea, that this could
solve my problem. As long as I work from my django-app this will be a
proper solution. And if somebody gets to work on the database
directly, well it's one join more, but doable.

> and from Tom's:
>
>> In the example, it is evident that the OP wants MTI, since he includes
>> the foreign key links in the class definition - there is no clearer
>> indicator than this!

I'm afraid you do me too much honor. During trying the concepts of
inheritance in django I just was never sure, what is done implicitely
and what I have to specify. So I just thought "it might help and won't
do any damage".
As a site note, i programm several years now c++ and having a degree
in CS, but I tend to solve these problems too much from the brain but
from practice. That's why I thought, the data *must* be in the super
class. Up to now I don't know if i will need the data to be in place,
but till then I will solve the problem with the abstract super class.

The big difference is, -as I see it- I will not get real polymorphism,
as the base class would need to do the join on all it's child classes.
Is that true?

I just got it, it's the same question you just answered:
> As I said before, the only thing this *really* depends on is in this
> question: do you need to be able to do something in the lines of:
> Fruit.objects.all()?

So this helps me to solve it, just differently than I thought.
(which actually would justify a title change ;-) )

Thanks again :-)
Best regards,
Daniel

--
Daniel Walz - mcJack@gmail.com
Bremen, Germany

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate