Still testing: got a database error

19 views
Skip to first unread message

ghichtin

unread,
Jan 17, 2014, 12:55:22 PM1/17/14
to coinb...@googlegroups.com
Hi,
I've cleaned up everything from the test database, then I've begun to insert some test products of my own store, but when I got to the second one I've been warned that "something went wrong" and (on the terminal):

IntegrityError: (IntegrityError) column reference is not unique u'INSERT INTO products (name, description, reference, code, price, quantity, currency_id, category_id, image_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' (u'Peperone Lux F1', u'', u'', u'012524300018', u'1.2', 0.0, u'EUR', None, None)

Any idea?
Thanx,
S.

Jad Kik

unread,
Jan 17, 2014, 6:15:11 PM1/17/14
to coinb...@googlegroups.com
Hi!

That's because we are making the assumption that the "reference" of a product is unique and not empty. So if you create two products with an empty reference, the second one is not unique and it fails.

The error message has to be more descriptive than "something went wrong", so I'll get to that.
And I'm not sure wether a "reference" is something that is unique and/or required in the first place.

I was working on fixing the database but then something came up and I started working on something else (it should have been a priority, but there are so many priorities I don't know what to start with).

tl;dr just specify a unique reference to your products (by "reference" I mean the reference thing your supplier gives to every item, well depends on the supplier)

Thanks!

ghichtin

unread,
Jan 17, 2014, 6:36:08 PM1/17/14
to coinb...@googlegroups.com


Il giorno sabato 18 gennaio 2014 00:15:11 UTC+1, Jad Kik ha scritto:
Hi!

That's because we are making the assumption that the "reference" of a product is unique and not empty. So if you create two products with an empty reference, the second one is not unique and it fails.



Thanks a lot, always Flash-fast.
Next question would have been "What exactly do you mean by reference?" but now I think it's not necessary. Not sure if all products have one but I can manage it.

And sorry if I didn't read the error message enough carefully: it's written there. I misunderstood "column reference" as "a reference to a column" (I'm not a database guy at all)

So, going on!

S.

Jad Kik

unread,
Jan 17, 2014, 6:43:47 PM1/17/14
to coinb...@googlegroups.com
You shouldn't be a database guy to understand that, we should make it clearer to non-database guys :P and sorry because we failed!

ghichtin

unread,
Jan 17, 2014, 6:55:48 PM1/17/14
to coinb...@googlegroups.com


Il giorno sabato 18 gennaio 2014 00:43:47 UTC+1, Jad Kik ha scritto:
You shouldn't be a database guy to understand that, we should make it clearer to non-database guys :P and sorry because we failed!


You are right, it would be enough to be able to read&understand ah ah ah :-D
Keep it up, you are doing a great work!
(I'm not flattering, I really mean it)

S.
Reply all
Reply to author
Forward
0 new messages