I have got this query in Peewee:
return c = Products.get(Products.sku == article).get()
How to check if it returns data?
I tried:
if c.count() > 0:
if len(c) > 0
It does not work for me
This is full code:
try:
r = self.isProductExist(row['sku'])
## if (r.count() == 0):
except peewee.DoesNotExist:
# Insert product
def isProductExist(self, article):
return Products.get(Products.sku == article).get()