#24436: model's __init__ tries to set all non-concrete fields -------------------------------+----------------------- Reporter: ktosiek | Owner: nobody Type: Bug | Status: new Component: Uncategorized | Version: 1.8alpha1 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+----------------------- Using kwargs when creating models makes Django try to fill non-concrete fields, even if they were not in those kwargs. This breaks (at least) django-hvad which adds some fields that can't be accessed at all until some other model instance will be created.
It looks like the problem is this line: https://github.com/django/django/blob/5cf96b49e43daea6d4a0ba1c80c45e90c74f4e47/django/db/models/base.py#L380 - it sets field_iter to _meta.fields, and then never filters non-concrete fields out. -- Ticket URL: <https://code.djangoproject.com/ticket/24436> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.b264c7e94eeba396e47d6e6f8c37ae50%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.