#26304: Unable to use unmanaged ManyToMany through models when backed by a View.
----------------------------------------------+--------------------
     Reporter:  schinckel                     |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.9
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 Given an unmanaged ManyToMany through model, (i.e., where Meta.managed is
 explicitly marked as False), running tests attempts to call "sqlflush",
 and truncate this table.

 However, I have a situation where this model is actually being backed by a
 (Postgres) View, which cannot be truncated.

 It seems that
 
https://github.com/django/django/blob/53ccffdb8c8e47a4d4304df453d8c79a9be295ab/django/db/backends/base/introspection.py#L83
 shows that all many-to-many fields are added for flushing, ignoring
 managed status.

 I believe that this can be resolved by only adding those many-to-many
 fields that do not have a through model marked as unmanaged.

--
Ticket URL: <https://code.djangoproject.com/ticket/26304>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.64806ed010b9b5b2cb16070056b0887e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to