Dear all,
this is a very strange question, but I'm kind of stuck and I'm wondering if anyone was in the same situation.
I have a class called Location, of this form
class Location(models.Model):
name = models.CharField(max_length=32,)
marker = models.PointField(srid=4326) # the marker
objects = models.GeoManager()
I have a very long geographical queryset that work properly and return the right result
ItemTemplate.objects.filter(producer__user__profile__location__marker__within=poly)
To make this work, I've patched the UserManager from django, in order to extend from the GeoManager, so geographical queryset can be executed also through the user.
When I than added another class with a ForeignKey to ItemTemplate, I cannot perform this queryset:
Item.objects.filter(item_template__producer__user__profile__location__marker__within=poly)
Note that also the smallest queryset:
Location.objects.filter(marker__within=poly)
does not not work anymore, and I receive the same error
FieldError: Join on field 'marker' not permitted. Did you misspell 'within' for the lookup type?
I was thinking that maybe I'm making too many joins, but I'm not sure this is the real problem.
Got any idea/where to look?
Best,
Michele