Q:

Django admin export issue

admin.site.register(RegistrationOTP)    
class RegistrationOTPResource(resources.ModelResource):
    class Meta:
        model = RegistrationOTP
        export_order = ('country','phone_number','otp','created_date','is_verified')

class RegistrationOTPAdmin(ImportExportModelAdmin):
    resource_class = RegistrationOTPResource

here is models.py
class RegistrationOTP(models.Model):
    country = models.ForeignKey(Country,on_delete=models.CASCADE, related_name='otp_country', default=1)
    phone_number = models.CharField(max_length=13)#, unique=True, validators=[phone_regex],
    otp = models.PositiveIntegerField()
    created_date = models.DateTimeField(auto_now=True)
    is_verified = models.CharField(choices=YES_OR_NO, default='no', max_length=10)

    def __unicode__(self):
        return '%s : %s'% (self.phone_number, self.otp)

Here i am doing as per documentation but it is not showing export csv option in admin

A:

class RegistrationOTPResource(resources.ModelResource):
    class Meta:
        model = RegistrationOTP
        fields = '__all__'
        export_order = ('id','country','phone_number','otp','created_date','is_verified')

try this, i guess due to missing fields section, it is not working

