def queryset(self, request):
                qs = super(EventAdmin, self).queryset(request)
                if not request.user.is_superuser:
                        qs = qs.filter(city=request.user.get_profile().res_city)
                return qs

it works fine as but it list out all the city's events

        def queryset(self, request):
                qs = super(EventAdmin, self).queryset(request)
                if request.user.is_superuser:
                        qs = qs.filter(city=request.user.get_profile().res_city)
                return qs

but when i change the if condition it gives error message

Database error

Something's wrong with your database installation. Make sure the
appropriate database tables have been created, and make sure the
database is readable by the appropriate user.


--~--~---------~--~----~------------~-------~--~----~
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 
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