[Django]-How to dealing with a 'str' object has no attribute '_meta' error?

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

Leave a comment