two modelformset_factory in one view , both model relates to each other

Skip to first unread message


Nov 27, 2021, 6:31:40 AM11/27/21
to Django users
Hi ,  i'm trying to implement two formset in one view , one of the formsets should be pop up modal form : here is the models
note : if it requires i'll pay for that task 

class MobileCollection(models.Model): 
mobile = models.ForeignKey(ModelCategory,on_delete=models.PROTECT,related_name='model_category') 
qnt = models.IntegerField() 
price = models.DecimalField(decimal_places=3,max_digits=20) 

class Imei(models.Model): 
 mobile =   models.ForeignKey(MobileCollection,on_delete=models.PROTECT) 
 imei =  models.CharField(max_length=15,unique=True) serial_no = models.CharField(max_length=7,unique=True,blank=True,null=True) status = models.BooleanField(default=True) def __str__(self): return f'{}-{self.imei}'

if quantity = 10 then we have 10 unique imei , for each mobile item we have multiple imei , the im ei should be inserted in a pop up modal

here is the entire question on stackoverflow 

thank you in advance .. 


Nov 27, 2021, 8:52:30 AM11/27/21
to Django users
please is there any solution ?
Reply all
Reply to author
0 new messages