Hi,
I am experiencing an issue on annotate function only on my production
site only when executing the code on a normal navigation (the shell
command on production has no problem).

This is the pseudo code :

# models
class Competition(model):
    title = char
    published = bool
    date = date
    discipline = FK('Discipline')

class Discipline(model):
    title = char

class Photo(model);
    pict = image
    competition = FK(Competition)


# views
def competition_list(request, competition_id):
    cs =
Competition.objects.all(published=True).annotate(photo_count=Count('photo'))
\
         .select_related("discipline").order_by('-date')
    # rendering ...

This view above works fine through the command line.
When it's executed with normal http request (a browser), it causes a
field error :
---
FieldError: Cannot resolve keyword 'photo' into field. Choices are :
(...All the choices including other reversed FK...)
---
Removing the annotate() removes the error.
I checked the db Indexes and they are all correct.

My actual configuration :
Django 1.1
Postgresql 8.3
Nginx
Gunicorn

Does anybody encountered the same issue ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to