What's the Better approach to do these?

19 views
Skip to first unread message

Fellipe Henrique

unread,
Aug 19, 2018, 11:29:16 AM8/19/18
to Django Users
Hello,

I need to build a system.. each user will be a customer.. and each costumer will be products and sales...

I do not want to build a system, and create "sub-domais" and for each sub-domains a create a "new" clone of my system... it's hard maintenance..

I think these:  each model, I create a FK, and change the Model Manager, to filter all query with User ID... so, show only models to each User.. (thanks for help me here on these)

But I found a issue... for each record, django will use ID.. so, for example:

User 1  - Product 1 - Product ID: 1
User 1  - Product 2 - Product ID: 2
User 2  - Product 1 - Product ID: 3
User 3  - Product 1 - Product ID: 4

Any idea how to do that better?!

Thanks!
T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

Julian

unread,
Aug 19, 2018, 6:15:44 PM8/19/18
to Django users
Hello Fellipe,

sounds like you're developing a multi-tenancy webapp. Maybe https://github.com/bernardopires/django-tenant-schemas is the right tool for you.

Regards,
Julian

Simon McConnell

unread,
Aug 21, 2018, 3:33:54 PM8/21/18
to Django users
Reply all
Reply to author
Forward
0 new messages