def save(self, *args, **kwargs): if not self.patient_number: self.patient_number = auto_number('PNT') if not self.name: self.name = 'Tn. Budiman' if not self.place_birth: self.place_birth = 'Jakarta' if not self.date_birth: self.date_birth = '2019-01-29' if not self.age: self.age = 30 if not self.phone: self.phone = '0859999999999' if not self.occupation: self.occupation = 'Wiraswasta' if not self.religion: self.religion = self.MUSLIM if not self.marital: self.marital = self.SINGLE super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.poly_number: self.poly_number = auto_number('POL') if not self.name: self.name = 'My Poly' super().save(*args, **kwargs)
def execute(self, request): data = request.data supplier = Supplier.objects.create(supplier_code=auto_number( Supplier.objects.all(), prefix='SPR'), name=data.get('name'), address=data.get('address'), phone=data.get('phone')) return supplier
def execute(self, request): data = request.data products = Product.objects.all() product = Product.objects.create( sku=auto_number(products, prefix='PRD'), name=data.get('name'), unit=data.get('unit').upper(), sales_price=data.get('sales_price'), stock=data.get('stock') ) return product
def save(self, *args, **kwargs): if not self.doctor_number: self.doctor_number = auto_number('DR') if not self.name: self.name = 'Dr. Aisah' if not self.gender: self.gender = self.FEMALE if not self.phone: self.phone = '+62' if not self.price: self.price = 100000 super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.medicine_number: self.medicine_number = auto_number('MED') if not self.name: self.name = 'My Medicine' if not self.unit: self.unit = 'pcs' if not self.stock: self.stock = 1 if not self.price: self.price = 1000 if not self.medicine_type: self.medicine_type = 'Tablet' super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.room_number: self.room_number = auto_number('KMR') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.action_number: self.action_number = auto_number('ACT') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.drug_number: self.drug_number = auto_number('OBT') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.payment_number: self.payment_number = auto_number('PAY') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.kit_number: self.kit_number = auto_number('KIT') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.treatment_number: self.treatment_number = auto_number('RWT') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.enrollment_number: self.enrollment_number = auto_number('REG') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.register_number: self.register_number = auto_number('REG') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.recipe_number: self.recipe_number = auto_number('RCP') super().save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.counter_number: self.counter_number = auto_number('LKT') super().save(*args, **kwargs)