Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango, Models, and Apps
    primarykey
    data
    text
    <p>I'm new to Django and MVT, so I apologize if this is a silly question. I've looked over some similar questions but am looking for a little additional clarity and whether I'm even attempting to do the right thing.</p> <p>Here's a simplified version of what I'm working on. Let's say I'm designing a Django interface to a pre-existing database. The database is old and other systems add data to it. The Django interface will be read only. Simple structure with 4 content tables:</p> <ol> <li>Widgets </li> <li>Creators (for simplicity, each Widget has one Creator)</li> <li>Customers</li> <li>Orders (customer many-to-many orders, orders many-to-many widgets)</li> </ol> <p>I started by creating a Django app called "Widget" that displays Widget information, and creating models for all of the tables in the database. This works great, with an url like /widget/1234 I get the information for Widget with id 1234, info from the Creator table, and how many times it has been ordered.</p> <p>Now I wanted to create an app called "Customer" that displays information for customers (data from Customer table, orders placed, widgets ordered, etc).</p> <p>Am I doing the wrong thing? Should there be a separate "Customer" app?</p> <p>If it does indeed make sense for there to be a separate "Customer" app, what do I do about the models? They are identical to the models used in the "Widget" app as they are dealing with the same tables in the same database. Do I just import from the other app? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload