#22831: Migrations should provide a way to dumpdata to an initial data migration
-----------------------------+------------------------------------
Reporter: gcbirzan | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by gc@…):
The implementation should be trivial. Ours, granted, using mock, looks
like this:
{{{
def loaddata(app_registry, fixture_name):
from mock import patch
_get_model = app_registry.get_model
with patch('django.core.serializers.python._get_model', _get_model):
from django.core.management import call_command
call_command("loaddata", fixture_name)
}}}
Obviously, that's a hack, but in a more generic way, this get_model can be
passed all the way down to the serializer. Yeah, okay, maybe not exactly
trivial, but close enough.
As for the speed... I could open a discussion, sure, but tomorrow.
--
Ticket URL: <https://code.djangoproject.com/ticket/22831#comment:2>
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/066.2be483c566ef90a7fa142e70461a3c9f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.