0

I am making a view, to make some POST requests on my Django server. I need a way to select something and the proper widget that I need for the same is Django admin panel's raw_id_fields.

Widget:

enter image description here

Popup:

enter image description here

I was looking for a jquery plugin to do the same, but couldn't find anything. Is there a plugin / widget to have this functionality in my own views.

Is there a way to use this exact widget in my views.

I found django-yaac whose README says that I can use this outside the admin. However I can't seem to figure out how to use this outside the admin.

Ishan
  • 3,303
  • 5
  • 29
  • 47

1 Answers1

0

I'm not sure if this helps you, but anywhere in your template you can access a model's id like this:

{{ myModelObject.id }}

You can use it in a hidden field or javascript variable, and then you can manipulate it however you like.

navid
  • 566
  • 6
  • 15