summaryrefslogtreecommitdiff
path: root/server/inventory/models.py
blob: e82f4f031f66d4ba8df457e709473f2e8604518d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.db import models
from locations.models import *
from objects.models import *
from django.contrib import admin


class InventoryObject(models.Model):
	object = models.ForeignKey(Object)
	notes = models.TextField()
	quantity = models.IntegerField()
	unitprice = models.FloatField()

class Inventory(models.Model):
	name = models.CharField(max_length=100)
	description = models.TextField()
	location = models.ForeignKey(Location)
	inventoryobjects = models.ManyToManyField(InventoryObject)

admin.site.register(Inventory)