Hi all,

I'm looking for some background about abstract models, specifically why
they aren't registered with the app registry as normal models are.

For some context, I'm working on a ticket [0] to refactor Django's lazy
model operations (used e.g. to resolve string references in related
fields). To acquire an actual model class from an "app_label.ModelName"
string, we use Apps.get_registered_model. However, as far as that method is
concerned, abstract models don't exist, so operations that wait on them are
never run.

It also means abstract models clutter the pending operations dict, making
it impossible to provide a good warning when there's a typo in a string
model reference, for example.

Fortunately this doesn't matter too much in practise, because concrete
subclasses work fine despite related fields not being hooked up right on an
abstract parent.

[0] https://code.djangoproject.com/ticket/24215

Cheers,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BKBOKz5V3TcqpphKxUx3gLfWvk9-G61%2B4AgCQHrQ6mZy6DocA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to