-
Notifications
You must be signed in to change notification settings - Fork 18
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
AddAnotherWidgets not filled #42
Comments
Can you please post some code so it’s easier to understand. |
In my case I have a model "project" that contains a CharField "title", and a ForeignKey "company". For "company" I want to use the AddAnotherWidget so the user can add companies (there's more to a "project" of course, but I try to limit the code to only what is relevant): models:
views (project_view is function based as this is what I knew when I started while view for company is class based as this is a requirement for AddAnother if I understood well):
forms:
urls:
Problem: Let's say I made a project with name = "first project" and company = "EvilCorp". If I check in admin this is saved properly, even if I created "EvilCorp" on the spot using the AddAnotherWidget (so that is working great!). When I load this project back to a form for editing however the field name correctly contains "first project", while company gives the default value of "------". Same goes for other "classic" widgets versus AddAnotherWidgets. Thanks for your support! |
My bad, this wasn't an issue with AddAnotherWidgets, but my very own mistake. |
Thanks for your great work.
I'm not sure if this is a bug or a mistake on my side (more likely), but when I load an existing instance in a form the AddAnotherWidgets are not filled with the current value. The "normal" fields are filled however.
I based my code on the example app, but that only has a submit option and does not let you load an existing instance.
Any idea what could be going wrong?
The text was updated successfully, but these errors were encountered: