Python Forum

Full Version: "django" is valid numeric from request.GET
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi , my problem solved solution check is numeiric query request get.
Idea ?
My CODE:
class ListViewPhoto(AdminAndStaffMixing, ListView):
    model = Photo
    context_object_name = 'photo'
    template_name = 'photo/list.html'
    paginate_by =25
    ordering = ['-created']
    def get_queryset(self):
        if self.request.method == 'GET':
            queryset = Photo.objects.all()
            album = self.request.GET.get('q', None)
            if album is not None:
                queryset = queryset.filter(album=album)
            return queryset
digit ?q=d
Error: ValueError

Idea? problem solved?


I'am italian my english school or studing english hobby.