Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'str' object has no attribute '_meta' #225

Open
samich80 opened this issue Nov 13, 2021 · 9 comments
Open

'str' object has no attribute '_meta' #225

samich80 opened this issue Nov 13, 2021 · 9 comments

Comments

@samich80
Copy link

samich80 commented Nov 13, 2021

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

@s-ali-mi
Copy link

s-ali-mi commented Dec 4, 2021

hi
me too :(
please help

@jamesoutterside
Copy link
Contributor

Hi @samich80 Can you provide some details of your setup, how your defining you model, version of python/Django etc. Cheers!

@s-ali-mi
Copy link

Hi yes me too
version of python: 3.9
version of django: 3

I used the same method to set up

please help

🙏🌹

@jamesoutterside
Copy link
Contributor

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.

@shavakano
Copy link

someone managed to fix this?

when adding the tag {% ratings object %} in the template, it throws this error

@radiac
Copy link
Contributor

radiac commented May 12, 2022

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.

@Asmedeus998
Copy link

Asmedeus998 commented Jun 24, 2022

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.

@dastiv21
Copy link

dastiv21 commented Jul 6, 2022

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.

@dnd9
Copy link

dnd9 commented Dec 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants