Skip to content
Advertisement

Tag: django-queryset

AttributeError: ‘tuple’ object has no attribute ‘model’. How to fix this error?

I’m new to Django. Please help me to solve this error. I’m not getting any solution. I tried many stackoverflow solutions and GitHub solutions but I’m not getting where the error is coming from. urls.py models.py views.py serializers.py Exception log Here is the github link of the app – Django I tried many stackoverflow solutions but I am not understanding

django getting all objects from select

I also need the field (commentGroupDesc) from the foreign keys objects. models.py views.py Here I get the commentGroup fine but I also need commentGroupDesc to put into my form. Answer At first, it’s not a good thing to name same your model field as model name which is commentGroup kindly change field name, and run migration commands. You can simply

Django get data from related model which has the FK

how can i make this queryset: models with Property.objects.all() I can see in the returned object that there is a listing_set let say: but it brings the entire model, and not the related to property_id; also tried to get Ota data in serializer with SerializerMethodField and perform a new query to get this info, but decrease performance significantly. Answer I

Django Traverse Foreign Keys

I have 3 models and I am trying to create a dashboard with a list of Trials that spans all Client Sessions for a specific client chosen via a filter. Here are the models: Here is the view that im trying to create Answer You have an error filter query you used Filter data. Expected is queryset. Change, trial_list =

Advertisement