AttributeError type object Chat has no attribute objects
This error occurs when you try to access the objects attribute on a model class that does not have a default manager defined.
To fix this error, you need to define a default manager for your Chat model. You can do this by adding the following code to your model:
class Chat(models.Model):
# your model fields here
objects = models.Manager() # define default manager
# your model methods here
By defining a default manager, you can now access the objects attribute on your Chat model without getting the AttributeError exception.
原文地址: https://www.cveoy.top/t/topic/1bL 著作权归作者所有。请勿转载和采集!