I am trying to add a filter on an existing queryset based on a condition but it doesn't work. This works queryset = None if self.is_instructor =
Suppose I have an object: survey = Survey.objects.all().first() and I want to create a relationship between it and a group of objects: respondents = Respond
I've been using a distance filter using regular django query filters within an OR-clause: # either it's within the preset distance of the location # OR it's not
I have problem with getting only values from QuerySet. I have my table: class Temperature(models.Model): id = models.IntegerField(primary_key=True) # AutoF
I'm new to Django. How to write COALESCE sql queryset in to django orm. query = 'SELECT COALESCE(max(CAST(order_no as UNSIGNED)), 0) as o,id from nanossc_Sales
I have a bit of a strange problem that I'm not quite able to explain. I have a django project with some old, stale objects lying around. For example, lets say
Imagine this simple model: class Expense(models.Model): price = models.DecimalField(decimal_places=2, max_digits=6) description = models.CharField(max_len
how can i find the top 3 blogpost with the maximum comments here are my models: class BlogPost(models.Model): title = models.CharField(max_length=250)
Hy please am new to Django,I have a childmodel(relationship) referencing a parent model(Profile) through a foreign key. I want to get the relationship status of
The model is class WeeklyStrMst(BaseModel): StoreId = models.AutoField(primary_key=True) TDLinx_No = models.IntegerField(blank=True, null=True, default=
I'm using Django ORM queryset for chart, and having difficulty with changing the format of output 'source': ActivityLog.objects.filter(requestType='add',doDat