GithubHelp home page GithubHelp logo

Comments (3)

sinisaos avatar sinisaos commented on June 5, 2024 1

@JoshYuJump Right now you can't because of this line. If we change

response = await row.save().run()
json = dump_json(response)

to this

await row.save().run()
json = dump_json(row.to_dict())

we can get the response like this.

{
    "id": 1,
    "name": "testing"
}

Another option is to not use PiccoloCRUD and write your own crud methods and use same to_dict() method.

from piccolo_api.

JoshYuJump avatar JoshYuJump commented on June 5, 2024

@sinisaos
I'm curious if you have any plans to do this in a future release.

or it's a good practice right now?

from piccolo_api.

sinisaos avatar sinisaos commented on June 5, 2024

@JoshYuJump I think dict is a much better response than list, since we are POST single item. I can make a PR with these changes, but I'm not a maintainer and @dantownsend has to approve changes, if he agrees with these changes.

from piccolo_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.