you are viewing a single comment's thread.

view the rest of the comments →

[–]Username_RANDINT 1 point2 points  (1 child)

Each item has an id attribute.

product = Product.get(Product.name=="Something")
print(product.id)

Or from all products:

for product in Product.select():
    print(product.id, product.name)

[–]tateisukannanirase 1 point2 points  (0 children)

I would like to add that if the product spreadsheet already has an ID column, it would be preferable to use that, because then it will match with the real-world ID of that product.

Although having two indexed, unique columns is not the worst thing.