Open paulz1 opened 2 years ago
I think we might be able to enable this use case with minimal changes.
You'll have to dig into the Django JS code, start here
which leads to
https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/popup_response.html
Maybe it needs changes in the Django code, not sure.
If you find anything helpful, feel free to discuss here.
Thank you very much for quick reply :-)
I'm viewing actually respond_script
and thinking how I could adapt it to my needs.
If this could be realized inside django-addanother (may be creating some class ChoosePopupMixin
) it would be probably very useful for me and other peoples.
If I advance or find something on this subject I'll of course share it here.
At first thank you for very good and useful add-ons.
I have mostly a question than an issue. Sorry to ask it here, the issues are probably not for this purpose, but I didn't find any other place to ask it. My problem is that I want to use django-addanother add-on not for add the new item, but to choose from existing one.
In two words...
I have a model with ForeignKey field. In the form this field is done using Select Dropdown menu. I'd like instead to have a button that will open a popup window where user choose the Object, click Submit, then popup is closed and the chosen Object is inserted into initial Form.
So my questions are :
Do you think I could realize such functionality with django-addanother ?
Is this functionality already included in django-addanother ? I could not find any explicit example in the doc.
I allow myself to ask this question as the desired functionality is not very hard to obtain. In fact, if in the very basic example we inherit
class PersonCreate
not formCreateView
but fromListView
we could easily get the list of related objects :The only question is that I should return from this PersonCreate popup to get it into thi initial form.
Once again, sorry for this not very relevant question.