Django __str__ returned non-string (type NoneType)

you can try:

def __str__(self):
    return str(self.ProductName) if self.ProductName else ''

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)