title: Generic relation in django, queryset with aggregate
body: <p>I use django 1.6 and generic relation in models. And I have problem with <code>aggregate</code> function in model:</p>
  
  <p>Here is part of my view:</p>
  
  <pre><code>class EventListView(PageContextMixin, ListView):
      model = Activity
      template_name = 'events/eventlist.html'
  
      def get_queryset(self):
          seasons = Season.objects.all()
          if not self.request.user.is_superuser:
              seasons = seasons.filter(is_active=True)
              active_seasons_ids = list(IsActiveFlag.objects.exclude(is_active=False).values_list('id', flat=True))
              seasons = list(Season.objects.filter(isactiveflags__id__in=active_seasons_ids))
          minmax = seasons.aggregate(Min('start'), Max('end'))
          min_date = minmax['start__min']
          max_date = minmax['end__max']
  
          active_sale_and_cycles_ids = list(SaleAndCycle.objects.exclude(is_sale_active=False).values_list('id', flat=True))
          filters_sale = Q(sale_and_cycles__id__in=active_sale_and_cycles_ids)
          active_is_cyclic_event_ids = list(SaleAndCycle.objects.exclude(is_cyclic_event_active=False).values_list('id', flat=True))
          filters_cycle = Q(sale_and_cycles__id__in=active_is_cyclic_event_ids)
          sales_events_activities = Activity.objects.filter(Q(filters_sale, online=True) | Q(filters_cycle, online=True))   
          sales_events_ids = sales_events_activities.values_list('id', flat=True)
          minmax_sales_events_activities = sales_events_activities.aggregate(Min('start'), Max('end'))
          max_date_sales_events_activities = minmax_sales_events_activities['end__max']
  </code></pre>
  
  <p>I get an error in this place:</p>
  
  <pre><code>minmax_sales_events_activities = sales_events_activities.aggregate(Min('start'), Max('end'))
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>no such table: events_saleandcycle
  </code></pre>
  
  <p>But there is table in database (I use sqlite) with fields: id, content_type_id, object_id, position, is_sale_active, is_cyclic_event_active, cycle_link</p>
  
  <pre><code>class SaleAndCycle(SortableVAExtra):
      is_sale_active = models.BooleanField(default=False)
      is_cyclic_event_active = models.BooleanField(default=False)
      cycle_link = models.CharField(max_length=255, null=True, blank=True)
  
      def __unicode__(self):
          return str(self.is_sale_active)
  </code></pre>