nesh170 / asap-inventory-system

This is a concept inventory system for ECE458. It is built by ASAPsolutions
1 stars 0 forks source link

Update the disbursement model #98

Closed nesh170 closed 7 years ago

nesh170 commented 7 years ago

Need to have the cart metaphor assigned to one admin

nesh170 commented 7 years ago
class Cart(models.Model):
    disburser = models.ForeignKey(User, on_delete=models.CASCADE, related_name='disburser', limit_choices_to={'is_staff': True})
    comment = models.TextField(null=True, blank=True)
    receiver = models.ForeignKey(User, on_delete=models.CASCADE, related_name='receiver', null=True, blank=True)
    timestamp = models.DateTimeField(auto_created=True)

class Disbursement(models.Model):
    cart = models.ForeignKey(Cart, on_delete=models.CASCADE, related_name='disbursements')
    item = models.ForeignKey(Item, on_delete=models.SET_NULL, null=True, related_name='disbursed')
    quantity = models.PositiveIntegerField()
nesh170 commented 7 years ago

https://github.com/nesh170/asap-inventory-system/pull/101