Skip to content

Best way to get an instance id on TypedModels, without saving first #223

Description

@milanmitrovic

As in the title, I have a TypedModel and want to access the id field. The field gets populated after I save, but I would like to avoid one extra write just to get an id. I saw in the docs that for regular Model instances the id field is populated on creation, and you don't need to save the data to get an id. I would like to have the same functionality on TypedModels, but I don't know what is the simplest way to do that.

Can you help me out?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions