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
#2
Whatever CRUD is, it doesn't have an objects property. You're getting an error for trying to use something that doesn't exist.

If you think that's not right, you'll have to give a whole lot information, such as what a CRUD is.
Reply


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,183 Sep-30-2022, 02:36 PM
Last Post: DeaD_EyE
  Accessing a data-phone tag from an href KatMac 1 2,864 Apr-27-2021, 06:18 PM
Last Post: buran
  Getting error while accessing input box sumandas89 0 2,893 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,574 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