Sorry I have the same similar problem, please help, thank you!!
I put the question on stackoverflow, there are questions and reference 
materials attached.

So you can click the link to enter : 
https://stackoverflow.com/questions/66310704/attributeerror-type-object-product-has-no-attribute-objects

for
File "C:\Users\georgiawang\PycharmProjects\libshopapp\store\views.py", line 
195, in updateItem** product = Product.objects.get(id=productId) 
AttributeError: type object 'Product' has no attribute 'objects'**
sagar ninave 在 2020年4月27日 星期一下午11:10:21 [UTC+8] 的信中寫道:

> i got answer 
>
> i was doing this:
> from .models import User
> user = User.objects.filter(pk=user_id) 
>
> instead i do this:
> from .models import MyUser
> user =  MyUser.objects.filter(pk=user_id) 
>
>
> error gone
>
>
>
>
> On Mon, Apr 27, 2020 at 6:57 AM Kasper Laudrup <lau...@stacktrace.dk> 
> wrote:
>
>> Hi Sagar,
>>
>> On 27/04/2020 14.25, sagar ninave wrote:
>> > i am getting this error
>> > 
>>
>> It's hard to guess since you don't show where your User class comes
>> from, but it doesn't seem like its inheriting from the Django model class.
>>
>> The error message is quite clear. Look at your User model.
>>
>> Btw. just a hint: please try to "return early". It is quite difficult to
>> see which else branches are connected to which if statements in the code
>> following the one throwing the exception.
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/96eba188-98e9-4284-cbab-a3aa3c909c05%40stacktrace.dk
>> .
>>
>
>
> -- 
>
> <https://about.me/sagarninave?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>  
> sagar ninave
> about.me/sagarninave 
> <https://about.me/sagarninave?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c631cbb-2294-4350-b136-e6ef38d9f022n%40googlegroups.com.

Reply via email to