Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error accessing data
#1
Error:
Class 'CRUD' has no 'objects' member [E1101]
class CRUDList(ListView):
    model = CRUD

    def get_queryset(self):
        result = super(CRUDList, self).get_queryset()
        category = self.request.GET.get('category')
        if category:
            if self.request.GET:
                if self.request.GET.get('asc'):
                    [color=#D35400]result = CRUD.objects.order_by(category)[/color]
                elif self.request.GET.get('desc'):
                   [color=#D35400][/color]result = CRUD.objects.order_by('-'+category)[/color]

        return result
Reply


Messages In This Thread
error accessing data - by kaykay - Dec-12-2018, 05:22 PM
RE: error accessing data - by nilamo - Dec-12-2018, 06:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What is the error of not being able to pull data in this code? i didn't see an error? TestPerson 2 1,317 Sep-30-2022, 02:36 PM
Last Post: DeaD_EyE
  Accessing a data-phone tag from an href KatMac 1 2,994 Apr-27-2021, 06:18 PM
Last Post: buran
  Getting error while accessing input box sumandas89 0 2,974 Jul-13-2018, 12:22 PM
Last Post: sumandas89
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 8,863 Jul-13-2018, 10:44 AM
Last Post: mlieqo

Forum Jump:

User Panel Messages

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