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

Edit database 400 error: Too many fields. Maximum number of fields is 1000. #835

Open
2 tasks done
pimverschuuren opened this issue Oct 16, 2024 · 2 comments
Open
2 tasks done

Comments

@pimverschuuren
Copy link

Checklist

  • The bug is reproducible against the latest release or master.
  • There are no similar issues or pull requests to fix it yet.

Describe the bug

I have an object that I am trying to edit from the admin panel. The model field is a list of enum values for which I want to add one of the values to the list. The annoying thing is that for some objects with the same model I can alter it fine. However, for some objects the admin page shows the message:
image

I know this is not much to go on but does anyone have any idea what it might be and how I can further my investigation? Please let me know if you need more info

Steps to reproduce the bug

No response

Expected behavior

No response

Actual behavior

No response

Debugging material

No response

Environment

Additional context

No response

@aminalaee
Copy link
Owner

Please provide a minimum code to reproduce this and maybe add the traceback here.

@ahmedelgamal0
Copy link

The error “Too many fields. Maximum number of fields is 1000.” occurs because the admin panel automatically generates a form for editing database models. If your model has a large number of fields or relationships, this can exceed the default field limit set by the server or framework.

Use form_columns or form_excluded_columns as mentioned in the docs of sqladmin (docs/cookbook/optimize_relationship_loading.md)
https://github.com/aminalaee/sqladmin/blob/main/docs/cookbook/optimize_relationship_loading.md#using-form_columns-or-form_excluded_columns

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

3 participants