search - Django admin - Add button for ForeignKey in inline -


In a DNS administrator window, I would likely like to take an existing entry in DB as an area in an inline zone.

My models are like this (it's a weird way to design, this is just an example):

  class buyers (models.Model): Name = Models.CharField (max_length = 255) class vendor (models.Model): name = models.CharField (max_length = 255) class association (models.Model): type = model.yrgyinke (buyer) type = model. ForeignKey (vendor)  

In the Seller Admin page, I have an inline (tabular inline) list for all the affiliates for the vendor for all buyers. Or was.

class association inline (admin.TabularInline): Model = Assigning Class Credar Admin (admin.ModelAdmin): inlines = (DevisAssignationInLine,)

Representation in the field The seller has a text input instead, instead, I would like to click a button, which opens a search page, where I can search the sellers in DB, click on it and that's it, it is related to the buyer.

How do you do that?

is what you are looking for:

  class BuyerAdmin ( Admin.ModelAdmin): raw_id_fields = ("union",)  

Comments

Popular posts from this blog

c# - Wcf first request is slow? Solution on service? -

c# - Show a huge number of data in DevExpress GridView -

c - What are pthread cancelation points used for? -