4π
It seems that obj
is a string value. And not a model instance. Please verify the value of the obj
variable.
Edit :
The explanation given in the usage documentation is for a detail view (having more or less a main object).
If you are willing to display a rating per restaurant in the found_entries
you might have to do some changes. (If not please mention it)
The class overall_rating
is hard-coded in this line. To be able to do a rating per restaurant in search results, you will have to do so changes.
π€Anas
1π
just change your 2 template tags into like this:
{% overall_rating yourappmodel as the_overall_rating %}
and {% user_rating_js request.user yourappmodel %}
π€panjianom
- [Django]-How to make django-crontab execute commands in Docker container?
- [Django]-Django how to save model in view
- [Django]-Chinese django translations not working
- [Django]-Change field names in a Django query
- [Django]-Using list comprehension instead of for loop when working with Django QuerySets
Source:stackexchange.com