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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -