12 views
Skip to first unread message

Юрій Хлян

unread,
Nov 20, 2015, 10:29:10 AM11/20/15
to django...@googlegroups.com
Good day, to everybody.

I read that Django supports several databases in one project. This feature would be very useful for me, since there is a task to organize structure of 5 e-shops with common warehouse (stock records). Taking into account that both prices and product sets in these shops can differ, I decided to solve this task in the following way:
All information is stored in two databases. The first one (unique for each shop) contains all data about this shop (customers, baskets, products, prices, etc.), except information about product stock in the warehouse. Data on the product stock is stored in separate common database. The latter one contains only ID_product, number_in_stock, reserved_products and low_stock_threshold.
But then I’ve read that Django can’t link field via ForeignKey from another database. Can this issue be solved? Or I’ve misunderstood something.

Or this solution is not good and it would be easier to create 5 different databases and synchronize them using three warehouse parameters? If this option is better, please help me with its implementation.

Maybe someone has a better solution. I will be very grateful for any assistance.
Reply all
Reply to author
Forward
0 new messages