D
D
Denis Pupchenko2017-04-26 22:34:12
Django
Denis Pupchenko, 2017-04-26 22:34:12

How to add an edit and add record button to raw_id_fields in the admin panel like fields?

class AuthorAdmin(admin.ModelAdmin):
    fields = ('name',)

fields You can edit and add a new entry, but it is not convenient to select entries if there are many related objects.
2c405e263c4b469ba700cd5dfab79040.png
class AuthorAdmin(admin.ModelAdmin):
    raw_id_fields= ('name',)

189a2d41b51a4ed7b8df32c443c912a0.png
If raw_id_fields then it is convenient to choose, but there is no way to edit and add a new entry as fields.
Are there other ways?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RayOtto, 2020-09-30
@RayOtto

Maybe this will fit?
https://docs.djangoproject.com/en/2.1/ref/contrib/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question