On 02/11/2015 08:17 PM, Alex Hill wrote:
> I'm still curious as to why abstracts aren't registered – is that a
> requirement of some feature of the app registry design, or is it just
> that way because?
I think it's just a natural consequence of not considering them to be
real models.
One practical issue is that currently abstract models are not required
to be in an app or have an app-label / app-config at all, which I know
people take advantage of (because when we temporarily broke it after the
merge of app-loading, people complained); it would be hard to keep this
working and also add abstract models to the app-registry.
> I think what I would like to do is just declare that string references
> in related fields are only resolved in concrete models. In abstract
> models, they can just remain as string references until the fields are
> copied and contributed to concrete subclasses, at which point they'll be
> resolved normally. Then if abstract models do end up in lazy operations,
> they can be considered an anomaly just as a typo would be; we don't need
> to account for them specifically.
>
> Can you see any problem with that approach?
That seems fine to me. I don't think anyone should be trying to do
anything with relation fields on an abstract model. In fact, I've never
seen anyone try to do anything at all with an abstract model other than
inherit from it.
> I've just implemented that change and the test suite passes – not
> surprising given that there were edge cases where this was happening
> anyway (e.g. abstract models with relations to "self").
Carl