I’ve these models
class ServiceType(BaseModel):
name = models.CharField(max_length=150)
is_active = models.BooleanField(default=True)
class EventStaff(BaseModel):
event = models.ForeignKey(Event, on_delete=models.PROTECT, related_name="event_staff")
service_type = models.ForeignKey(ServiceType, on_delete=models.PROTECT, null=True)
is_active = models.BooleanField(default=True)
In django admin we are able to add the ForeignKey fields like service_staff when we are creating EventStaff instance by clicking plus icon and popping a new window.
We can add service_staff then that new service_staff also available in the options of EventStaff’s service_staff select options.
I want to implement the same functionality in my templates where I can do the same, Is there a blog or maybe any post or tutorial.
Please let me know.