Python Forum
"django" is valid numeric from request.GET
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"django" is valid numeric from request.GET
#1
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to detect whether the proxy is valid? swiftproxy 0 1,198 Aug-12-2024, 07:53 AM
Last Post: swiftproxy
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 4,562 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020