python - Should I be using two dictionaries or is there a better way? -


i want create new file based on jambarcode looks price jamprice , rest of information jamdetails , puts new file.

i've got (at moment) 2 dictionaries following:

jamprice = { "jambarcode": "1234", "price": "1", } print jamprice 

and

jamdetails = { "jambarcode": "1234", "colour": "red", "size": "small" } print jamdetails 

is right data structure using, , going right way or there easier way it? i've been looking @ http://www.pythonforbeginners.com/dictionary/how-to-use-dictionaries-in-python help.

conceptually, i'd separate these 2 tables in database: product info, , product retail info. latter should contain info necessary sell item, in addition retail price going department count under, how many units sold, restrictions on product (is alcohol? need age-verify sale?)

the latter should contain foreignkey point former, or in case of dictionary should contain matching information (e.g. barcode, have).


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -