Search code examples
pythondjangodjango-modelsdjango-1.6

Django 1.6 for_concrete_model explained


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().


Solution

  • 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.