django-dynamic-fixture icon indicating copy to clipboard operation
django-dynamic-fixture copied to clipboard

Support for GenericForeignKey

Open alexhayes opened this issue 10 years ago • 1 comments

I'd like to propose better support for GenericForeignKeys.

I'd like to do the following;

owner = G(ModelWithDefaultValues)
G(ModelWithGenericForeignKey, owner=owner)

This would automatically set the owner_type and owner_id.

I've added a very basic failing test which could probably be expanded upon.

In terms of actual support in DDF I have not implemented this, however I'd be willing to attempt it if it's something the core devs believe should be a feature.

alexhayes avatar Sep 04 '15 00:09 alexhayes

Hi @alexhayes . Sorry for the delay.

I suppose this could be interesting. Not sure yet how hard would be the implementation.

If you create a PR I would be glad to merge it.

paulocheque avatar Jan 04 '20 02:01 paulocheque