--
Ticket URL: <https://code.djangoproject.com/ticket/26144>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 1
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Looking at the proposed [https://github.com/django/django/pull/6051 pull
request], I think it would be fine to warn if the proxy model is specified
in the command args, e.g. `dumpdata app.ProxyModel`, but otherwise I think
warnings would clutter the output.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:1>
Comment (by kissgyorgy):
What about warn and add an ```--ignore-warnings``` option to the dumpdata
command?
What happened me that I lost data when I dumped my "core" app, assuming it
would dump everything.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:2>
Comment (by timgraham):
I don't see an advantage of burdening everyone that uses proxy models with
warnings for normal `dumpdata` usage. If we extended the warning to if an
app is specified like `dumpdata app` would that have helped?
The behavior seems intuitive to me, however, the
[https://docs.djangoproject.com/es/1.9/ref/django-admin/#dumpdata-app-
label-app-label-app-label-model dumpdata documentation] doesn't seem to
mention it, so that's a candidate for an update as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:3>
Comment (by kissgyorgy):
Replying to [comment:3 timgraham]:
> I don't see an advantage of burdening everyone that uses proxy models
with warnings for normal `dumpdata` usage. If we extended the warning to
if an app is specified like `dumpdata app` would that have helped?
Sure, because if you dumpdata without parameters, everything will be
dumped. Absolutely not necessary to warn in that case at all.
It would be just nice if it would warn that you "might" lose some data if
somebody is unobservant like me :)
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:4>
Comment (by charettes):
What about issuing a warning if a proxy model is included but not the
concrete model it's proxying?
Since `dumpdata` uses `_base_manager` the concrete model instances
returned should be the same as what the proxy instances would have been.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:5>
Comment (by timgraham):
If not too complicated, sounds good to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:6>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
Comment:
Looks good, pending some cosmetic edits.
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"0edb8a146fd6c60f4c3b1ad0a4a89963962f22af" 0edb8a1]:
{{{
#!CommitTicketReference repository=""
revision="0edb8a146fd6c60f4c3b1ad0a4a89963962f22af"
Fixed #26144 -- Warned when dumping proxy model without concrete parent.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:8>
Comment (by Simon Charette <charette.s@…>):
In [changeset:"275314512d7dd10065026f02f61931e4c62c9cc8" 27531451]:
{{{
#!CommitTicketReference repository=""
revision="275314512d7dd10065026f02f61931e4c62c9cc8"
Refs #26144 -- Used proxy_for_model instead of mro inspection.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26144#comment:9>