DEV Community

ravi2teja2016
ravi2teja2016

Posted on

Django multiple models , multiple fields lookup in autofield coloumn

I have two models BOQ and DPR boq model

choicestype=(('start','start'),('finish','finish'))

class boqmodel(models.Model):
    code = models.IntegerField()
    building = models.ForeignKey(building, on_delete=models.SET_NULL, null=True)
    level = models.ForeignKey(level, on_delete=models.SET_NULL, null=True)
    activity = models.ForeignKey(activity, on_delete=models.SET_NULL, null=True)
    subactivity = models.ForeignKey(sub_activity, on_delete=models.SET_NULL, null=True)
    duration = models.IntegerField()
    linkactivity = models.CharField(max_length=300,null=True,blank=True)
    linktype = models.CharField(choices=choicestype,max_length=300,null=True,blank=True)
    linkduration = models.IntegerField(default=0)
    plannedstart = models.DateField(null=True,blank=True)

Top comments (0)