weather = Weather.objects.filter(weather_date=self.target_date,zip_code=self.created_by.store.zip_code)
so, the solution was
def get_weather(self):
weather = Weather.objects.filter(weather_date=self.target_date,zip_code=self.created_by.store.zip_code)[0]
return weather
just return a single record....
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment