Django resource get all fields ( manytomany,foreign key etc.)

As you can see from my question, I want to download data from all other relevant tables from the users table.

class UserResource(resources.ModelResource):
    class Meta:
        model = User
        fields = ['__all__'] # But I want ALL FIELDS ( foreign key fields etc.)

I think fields = '__all__', not fields = ['__all__']. And when you want to add the extra field, you can set the extra_fields attribute.

...
fields = '__all__'
extra_fields = ['extra']
Back to Top