Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:59:08+00:00 2026-06-15T14:59:08+00:00

I am trying to make a small inventory app in a Django app. I

  • 0

I am trying to make a small inventory app in a Django app. I want to be able to see the stock on hand, where it is (between two places and all together), purchase to add to inventory, and sell to reduce inventory. Tracking sales would be nice. So all in all, there are about five things I would like to do. To track the location, I was thinking of listing warehouse one as 1 and two as 2, and could query WHERE field = 1, but if I have the same product in two places, I would run into an issue. I also don’t know the best way to approach it. Reading through post here, I see some people saying to just track sales, and total them in a flat db, others to remove from the db, but that would lead to discrepancies. This is my model.py so far, just really stabbing at the dark here, looking for some guidance.

from django.db import models

class Product(models.Model):
    product_ID = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=100)
    type = (
        ('WHT' , 'White Wine'),
        ('RED' , 'Red Wine'),
        ('SPRT', 'Spirits'),
        ('BR'  , 'Beer'),
    )
    size = (
        ('12' , '12oz'),
        ('16'  , '16oz'),
        ('375' , '375mL'),
        ('750' , '750mL'),
        ('1' , '1L'),
    )
    amount_per_case = models.IntegerField()
    warehouse = (
            (1 , 'One'),
            (2 , 'Two'),
    )
    on_hand = models.IntegerField() 

class Store(models.Model):
    store_ID = models.IntegerField(primary_key=True)
    store_name = models.CharField()
    store_type = (
            ('Supermarket', 'Supermarket'),
            ('Liquor Store', 'Liquor Store'),
    )
    store_address = models.CharField()
    store_phone = models.CharField()
    store_contact = models.CharField()

class Vendor(models.Model):
    vendor_ID = models.IntegerField(primary_key=True)
    vendor_name = models.CharField()
    vendor_address = models.CharField()
    vendor_phone = models.CharField()
    vendor_contact = models.CharField()

class Sale(models.Model):
    sale_date = models.DateField()
    sale_product = models.ForeignKey(Product)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:59:09+00:00Added an answer on June 15, 2026 at 2:59 pm

    You should make a Warehouse model and create a many-to-many relationship between Product and Warehouse, using the through option to specify another model to hold relationship details called something like WarehouseProduct, in which you store the counts. See this section of the docs, and the following section.

    P.S. You can do much the same thing to associate sales with particular stores, which seems to me to be something that would probably be of interest to you, as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a small GUI app and I want to use MigLayout
Trying to make a small countdown timer in my app but it's not working.
'm trying to make a small modification to django lfs project, that will allow
Im trying to make a small app in c++ that saves midifiles with this
I'm trying to make a small Mosaic programm, that draws squares randomly all over
I am trying to make a small thread example. I want to have a
I am trying to make a small inventory program using Access but I don't
I'm trying to make a small cms in php and mysql, and want it
I am trying to make a small game like app that has some interaction,
I'm trying to make a small XNA-based game, and I need to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.