Django - how to set up a project with sub-projects (sort of) -
i building new django project. example sake, lets it's managing multiple car dealerships. perhaps parent company owns 5-10 distinct dealerships, each dealership being in different city own staff , own inventory.
i'm trying figure out how best create django project handle structure. want high level view management can view dealerships , aggregate data, can drill down , manage each specific dealership , data. this:
- main project managing car dealerships
- main project needs have high level data such as:
- overview of dealerships
- overview of financial data (which aggregate of individual dealership financials)
- ability add new dealerships
but each dealership needs following info, specific that dealership:
- staff of dealership
- inventory of dealership
- financials dealership
looking @ one dealership makes easy, multiple apps within main project (staff
app, inventory
app, etc.). i'm thinking that, multiple dealerships, can still have approach (separate apps different areas).
but i'm struggling bit url patterns. normally, urls might setup this:
top_level ("/"), inventory ("/inventory/", include inventory_app(urls)), financials ("/financials/", include financial_app(urls)),
the thing is, if have multiple dealerships want view all urls, filtered based on 1 dealership. urls need show data, filtered on 1 dealership. things creating new staff member, needs /dealership_a/contacts/new/
or looking @ financials /dealership_a/financials/overview/
.
then, change dealerships, i'd go "dashboard" page (which top level whole project) , select different dealership. urls need filtered on that dealership. /dealership_b/contacts/new/
, /dealership_b/financials/overview/
basically, i'm trying figure out how design project, , urls properly, given project-wide filtering concept, urls change, based on dealership you're looking at. there django-esque way of doing this?
Comments
Post a Comment