Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fields of the same form #28

Closed
CleitonDeLima opened this issue Oct 14, 2017 · 4 comments
Closed

Update fields of the same form #28

CleitonDeLima opened this issue Oct 14, 2017 · 4 comments

Comments

@CleitonDeLima
Copy link
Contributor

How do I update fields of the same form using the same model?

Example:

...
'client': AddAnotherEditSelectedWidgetWrapper(
      forms.Select,
      reverse_lazy('client-create'),
      reverse_lazy('client-update', args=['__fk__'])
),
 'sender': AddAnotherEditSelectedWidgetWrapper(
      forms.Select,
      reverse_lazy('client-create'),
      reverse_lazy('client-update', args=['__fk__'])
)
@jonashaag
Copy link
Owner

Could you give a bit more context please? I don't understand what you're trying to accomplish and what your problems are.

@CleitonDeLima
Copy link
Contributor Author

Did not speak very well in English (use translator), sorry.

OK,

Today in django I have a model with two foreign key fields (both comes from the Client model) that use the same model. As in the example above, I have the sender and client (recipient, I made a mistake in declaring this). If I use the add popup in the sender field, it will refresh the select normally, but the select from the client field does not update. This occurs in Django admin as well.

This is discussed here:
https://code.djangoproject.com/ticket/11803

Do you know of any solution to this?

@jonashaag
Copy link
Owner

I see. Since django-addanother uses the admin JS, this is not something we'll fix in this project. Please try to contribute to the Django ticket.

@CleitonDeLima
Copy link
Contributor Author

In Django2.0 this works with autocomplete :D
https://docs.djangoproject.com/en/2.0/releases/2.0/#django-contrib-admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants