I am trying to merge 2 QuerySet objects with the following function: qs_user = queryset.filter(user=user) qs_favorites = Favorite.objects.get_by_user(queryset.model, user) combined = qs_user | qs_favorites
But I get: "KeyError: 'favorites_favorite'" raised from the depths of db-api (query.py line 321 svn version 7547): "get_by_user" method of the Favorite manager returns a QuerySet holding objects marked as favorite by the given user: class FavoriteManager(models.Manager): def get_by_user(self, Model, user): ctype = ContentType.objects.get_for_model(Model) rel_table = qn(self.model._meta.db_table) return Model._default_manager.extra( tables=[self.model._meta.db_table], # Use a non-explicit join where=[ '%s.content_type_id = %%s' % rel_table, '%s.user_id = %%s' % rel_table, '%s.%s = %s.object_id' % (qn(Model._meta.db_table), qn(Model._meta.pk.column), rel_table) ], params=[ctype.id, user.id], ) And 'favorites_favorite' is the table name as returned by "Model._meta.db_table" The line: promote = (rhs.alias_map[alias][JOIN_TYPE] == self.LOUTER) raises thi exception as "rhs.alias_map" does not contain the key 'favorites_favorite' This seems like a bug to me. Any ideas? -- omat --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---