Meta.fields contains a field that isn't defined on this FilterSet: ****
<p>I am using Django Filters package .</p>

<p>I define my filter in following way in the view </p>

<pre><code>class UnitFilter(django_filters.FilterSet):
    class Meta:
        model = Unit
        fields = [
            'floor', 'number', 'building','lease','leaseterm', 
            'lease__is_active','lease__is_terminated','lease__is_renewed',]
</code></pre>

<p>My Unit Model on which I filter is following </p>

<pre><code>class Unit(CommonInfo):
    version = IntegerVersionField( )
    number = models.CharField(max_length=30,null=True, blank=True)
    max_occupants = models.PositiveSmallIntegerField()
    floor = models.PositiveSmallIntegerField()
    rooms = models.PositiveSmallIntegerField()
    is_disabled_access = models.BooleanField(default=False)
    balcony_quantity = models.PositiveSmallIntegerField()
    building = models.ForeignKey(Building)
    recomended_price = models.DecimalField(max_digits=7, decimal_places=2)
    _lease = None
    _leaseterm = None
    #check = models.ManyToManyField(UnitCheck, through='UnitChecklist')

    def _get_total(self):

        from conditions.models import LeaseTerm
        from lease.models import Lease

        lease_dict = Lease.objects.filter(unit_id=self.id, is_active = True , is_terminated = False).aggregate(Max('id'))
        if lease_dict['id__max']:
            lease =  lease_dict['id__max'] 
        else:  
            lease =  0

        leaseterm_dict = LeaseTerm.objects.filter(lease_id=lease, is_active = True , is_terminated = False).aggregate(Max('id'))
        if leaseterm_dict['id__max']:
            leaseterm =  leaseterm_dict['id__max'] 
        else:  
            leaseterm =  0

        self._lease = lease
        self._leaseterm = leaseterm

    @property
    def lease(self):
        if self._lease is None:
            self._get_total()
        return self._lease

    @property
    def leaseterm(self):
        if self._leaseterm is None:
            self._get_total()
        return self._leaseterm
</code></pre>

<p>There is 2 calculated properties in this model 
lease and leaseterm</p>

<p>lease property has no problem when leaseterm gives me this error  </p>

<blockquote>
  <p>Meta.fields contains a field that isn't defined on this FilterSet:
  leaseterm</p>
</blockquote>

<p>why? it it a bug in django-filter?Any work around?</p>