Context: Linux Ubuntu, Apache2, Django 1.7, PostgreSQL.

As a volunteer of a no-profit company, say Company A, devoted to palliative 
therapies , I successfully set up a Warehouse Management System (WMS) project  
on one of their servers using django and exclusively its magical **** admin 
interface **** and apache. 
As usual in a WMS DBs, among others models, there are two key models  widely 
referenced by the other models of the application (let's call it WMS_A): the 
model "items" (list of pharmaceuticals, sanitary devices, etc.) and the model 
"suppliers" (list of suppliers complete of their addresses, emails, fiscal 
code, contacts,etc.) , referenced by model "items".
Concisely (Translated from Italian):

settings.py
.............
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',#, 'mysql', 
'sqlite3' or 'oracle'.
        'NAME': 'warehouse',                      # Or path to database file if 
using sqlite3.
        'USER': 'xxxxx',                      # Not used with sqlite3.
        'PASSWORD': 'yyyyyyyyyyyyyyy',                  # Not used with sqlite3.
        'HOST': '127.0.0.1',                      # Set to empty string for 
localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not 
used with sqlite3.
    },
...............
...............


models.py
.................
class Items(models.Model):
    code = 
models.CharField(primary_key=True,db_index=True,unique=True,max_length=20,db_column='code')
    description = models.CharField(max_length=255, db_column='description', 
db_index=True, unique=True)
    supplier = models.ManyToManyField(Suppliers)
     category = models.IntegerField(choices=categoria, 
db_column='categoria',default=2)
     .............................
#
    def __unicode__(self):
        return self.description
    class Meta:
        db_table = u'items'
        ordering=['description']

class Suppliers(models.Model):
    name = models.CharField(max_length=150, db_column='name', db_index=True)
    address = models.CharField(max_length=255, db_column='address', 
blank=True,null=True)
    zipcode = models.CharField(max_length=18, db_column='zipcode', 
blank=True,null=True)
    email = models.CharField(max_length=150, db_column='email', 
blank=True,null=True) 
    .......................
    def __unicode__(self):
        return self.name
    class Meta:
        db_table = u'suppliers'
        ordering=['name']


Now Company A  has just started another separated (and must be separated for 
law and fiscal reasons) no-profit company, say Company B, (dealing with 
palliative therapies for other diseases) in the same building of Company A, 
with a new and physically separated warehouse for which a django warehouse 
project similar to that used in Company A is needed (say with an application 
called WMS_B).  Now, Company B, on the ground of an agreement, will use the 
network and servers of Company A. 
I would like to use the same apache server and, above all, the same database 
"warehouse" (see above settings.py), create new and independent tables for a 
new application (WMS_B) BUT........  I would like to share models Items e 
Suppliers of WMS_A with WMS_B (both read-only in this case of Company B).

In a nutshell:
For handling warehouse items in Company A I would like to call:
http://10.15.0.1:8000/WMS_A

For handling warehouse items in Company B I would like to call:
http://10.15.0.1:9000/WMS_B


In WMS_B all tables/models are different from those of Company A BUT WMS_B 
should share  (as read-only) models Items and Suppliers of WMS_A.

What is the best way according to you experts to achieve this result?

Ciao
Vittorio
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B45DDBD3-EECA-4E8A-89E2-F252A0BC7E8E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to