django-star-ratings
django-star-ratings copied to clipboard
'str' object has no attribute '_meta'
when i add {% ratings object %} in template, i get the error:
Exception Value: 'str' object has no attribute '_meta' Exception Location: /usr/local/lib/python3.10/site-packages/django/contrib/contenttypes/models.py, line 27, in _get_opts
hi me too :( please help
Hi @samich80 Can you provide some details of your setup, how your defining you model, version of python/Django etc. Cheers!
Hi yes me too version of python: 3.9 version of django: 3
I used the same method to set up
please help
🙏🌹
Hey @0250902109
Would you be able to drop a snipped of your view, i.e what object is that's being passed to the template.
Cheers.
someone managed to fix this?
when adding the tag {% ratings object %} in the template, it throws this error
Hi @shavakano, would you be able to give us a snippet of your view, the bit that's passing object
into the template context?
At first glance we'd thought people might be passing in the wrong type of object, but given this keeps coming up it must either be a bug or gap in the documentation - but we can't recreate it ourselves here, so will need someone to share their code to dig into this any further.
someone managed to fix this?
when adding the tag {% ratings object %} in the template, it throws this error
disable STAR_RATINGS_OBJECT_ID_PATTERN = '[a-z0-9]{32}'
and it'll fix the issue.
I found the solution. The issue is a documentation issue.
You are required to set the object parameter in the {% rating object %} on the template.
I have the smae issue and am wondering how you could have gone about it. I also wanted to extend my Ratings model, do i have to import AbstractBaseRating from star_rating and if so kindly guide