On Thursday, June 24, 2021 at 4:24:22 PM UTC-5 murad...@gmail.com wrote:
Hi Django developers,i am new in Python,i want to develop a simple app stock management.can you give me a brief idea how to add device to stock if it hasnt assigned to employeei have below modelsclass Device(models.Model):STATUS = (('in use', in use),('available', 'available'))status =models.Charfield(choices=STATUS, max_length=32)name = models.Charfield(max_length=32)class Employee(models.Model):name = models.Charfield(max_length=32)class Assign(models.Model):notebook = models.ForeignKey(' Device ', on_delete=models.CASCADE)subscriber = models.ForeignKey('Employee', on_delete=models.CASCADE)
class Stock(models.Model):passI want if device is already has subscribers then aply its status to 'in_use' and remove it from Stock model and if device status is available then move it to Stock
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/774cd9f0-cb85-4c4a-a47c-239cc8eaef5fn%40googlegroups.com.
No comments:
Post a Comment