Re: How to access using foreing key

2020-12-13 Thread Peter of the Norse
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

Re: How to access using foreing key

2020-10-31 Thread David Nugent
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

How to access using foreing key

2020-10-30 Thread Ashutosh Mishra
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)