If you are looking for all of the Restaurants with a 5.0 rating, it looks like
Restaurant.objects.filter(rating_restaurant__rating = 5.0)
If you are looking for Restaurants with an average rating of 5.0, that’s a bit
trickier.
from django.db.models import Avg
Restaurant.objects.filter(rating_restaurant=5.0)
Regards
/d
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To view
class User(models.Model):
name=models.CharField(max_length=50,blank=True,null=True)
latitude = models.CharField('Latitude', max_length=30, blank=True,
null=True)
longitude = models.CharField('Longitude', max_length=30, blank=True,
null=True)
location = models.PointField(blank=True, null=True)
3 matches
Mail list logo