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

Post array data to ModelAdmin.create, get wrong response #69

Closed
albertix opened this issue Dec 2, 2022 · 0 comments
Closed

Post array data to ModelAdmin.create, get wrong response #69

albertix opened this issue Dec 2, 2022 · 0 comments

Comments

@albertix
Copy link

albertix commented Dec 2, 2022

using ModelAdmin Example, as default enable_bulk_create is False

class CategoryAdmin(admin.ModelAdmin):
    page_schema = "Category"
    model = Category
    #enable_bulk_create = True

post to /admin/CategoryAdmin/item

use data [{"name":"1","description":"1"},{"name":"2","description":"2"}], get correct response value_error.jsondecode.

but use data [{"name":"1","description":"1"}], get wrong response msg : success "data" : {"name" : "description", "description" : ""}`

change enable_bulk_create = True

class CategoryAdmin(admin.ModelAdmin):
    page_schema = "Category"
    model = Category
    enable_bulk_create = True

post to /admin/CategoryAdmin/item

use data [{"name":"1","description":"1"}] or [{"name":"1","description":"1"},{"name":"2","description":"2"}], get same wrong response msg : success "data" : {"name" : "description", "description" : ""}`

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