[Answer]-Getting tables values in dropdown list in django forms

1👍

In your ProtocolType model add __unicode__() method to return appropriate string for the protocol. That string will be displayed in the dropdown field.

Example

class ProtocolType(models.Model):
   #your fields
   def __unicode__(self):
        return self.name # if you have char name field in protocol, otherwise use appropriate field(s) to construct the string.
👤Rohan

Leave a comment