I need to dump and load fixtures of model objects without usage of primary keys. The model is flat. I know about natural keys in Django, spent a lot of time reading the documentation, but all documentation has solutions only for usage natural keys instead of relations (fk / m2m). This is totally not what I need.
I need something like this:
name = models.CharField(_('name'), max_length=100)
content = models.TextField(_('content'), blank=True)
./manage.py <SOME_LOADDATA_COMMAND> fixture1.json --natural
Django 1.6 does not provide a way to dump data with natural primary keys, but Django 1.7 does.
use_natural_primary_keys keyword argument is not supported by the base Django 1.6 serializer: https://github.com/django/django/blob/1.6.11/django/core/serializers/base.py#L20
So I suggest you either upgrade to django 1.7 (which I totally understand is not always possible) or you write your own serializer, drawing inspiration from the base Django 1.7 serializer (https://github.com/django/django/blob/1.7.11/django/core/serializers/base.py).