is it possible to change my display employe to a search block because when I select the numbers it displays a list which is not practical when I have a lot of numbers in my database.
You can define __str__()
method for your Employee
model, it result would be seen in admin dropdown
class Employee(models.Model):
first_name = models.CharField(max_length=50)
...
def __str__(self):
return self.first_name
Try select2 widget, this should be more than enough for you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.