Hi,
I am developing a stock management application and I am stuck at simple use case.
Following is my model for Stock:
class LiquidChemicalML(Stock):supplier_name = models.ManyToManyField(Supplier)
quantity_values = (
('Ounces', 'Ounces'),
('Millilitters', 'Millilitters'),
('Pounds', 'Pounds'),
('Liter', 'Liter'),
('Galon', 'Galon'),
('Kilogram', 'Kilogram'),
('Grams', 'Grams')
)
chemical_name = models.CharField(max_length=200)
chemical_quantity = models.IntegerField()
unit_of_measurement = models.CharField(max_length=20, choices=quantity_values)
purchase_date = models.DateField()
expiry_date = models.DateField()class LiquidChemicalML(Stock):
supplier_name = models.ManyToManyField(Supplier)
quantity_values = (
('Ounces', 'Ounces'),
('Millilitters', 'Millilitters'),
('Pounds', 'Pounds'),
('Liter', 'Liter'),
('Galon', 'Galon'),
('Kilogram', 'Kilogram'),
('Grams', 'Grams')
)
chemical_name = models.CharField(max_length=200)
chemical_quantity = models.IntegerField()
unit_of_measurement = models.CharField(max_length=20, choices=quantity_values) purchase_date = models.DateField()
I need to update my orders model with available quantity and literals. My Orders are:
class Orders(models.Model):
update_chemical = models.ForeignKey(…..
I just need your help to give me idea that how I can update my orders with multiple fields from Stock. For instance if I create a foreignkey I will only be able to select one of the "id" in available stocks. I need to let the user select or update multiple values in a FK based key. Please advise.
Best Regards,
Shazia