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

How to handle read only fields in add view #90

Open
iurisilvio opened this issue Jul 22, 2013 · 1 comment
Open

How to handle read only fields in add view #90

iurisilvio opened this issue Jul 22, 2013 · 1 comment

Comments

@iurisilvio
Copy link
Contributor

The commit ab23b39 broke the add view when the model has readonly fields. It happens because the form exclude readonly fields. It is fine to the edit view, but does not work to add view.

Should we split the model_form in something like edit_model_form and add_model_form or we have a better solution to it?

@DavidBindloss
Copy link

I've got this issue now... Whenever I add a readonly_fields tuple to a ModelView definition, Superadmin fails:

UndefinedError: 'instance' is undefined

After digging about in the code, it indeed looks like the reason that it doesn't work is that the add function doesn't hand the instance to the render function. Any news on when this might be possibly fixed?

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