سؤال

I'm looking at the Django doc 1.6 on GenericForeignKeys. I'm confused about this new statement means. Could someone explain?

for_concrete_model

New in Django 1.6.

If False, the field will be able to reference proxy models. Default is True. This mirrors the for_concrete_model argument to get_for_model().

هل كانت مفيدة؟

المحلول

Proxy models are a form of model inheritance.

Previously, a generic foreign key could reference a 'concrete' model (i.e. an original model), but not a proxy model.

The new concrete_for_model parameter introduced in Ticket 17648 allows you to reference a proxy model if you use concrete_for_model=False.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top