Skip to content

Create typename variable when generating models.py #54

Description

@benbridts

If you want to throw an already exist error, you currently do:

raise exceptions.AlreadyExists('MyOrg::Foo::Bar', model.BarId)

It would be nice if this could be:

from models import resource_type
raise exceptions.AlreadyExists(resource_type, model.BarId)

or even

raise exceptions.AlreadyExists(model)

Activity

  1. self-assigned this
    on Nov 23, 2019
  2. tobywf commented on Nov 23, 2019

    @tobywf
    Contributor

    that makes sense, we'll need the type name for metrics publishing anyway so this would be a great enhancement.

    just need to find a home for it. since it's very difficult to change the type name after initialisation of the codebase, i'd be inclined to add it to handlers.py as a constant and pass it to Resource when we initialise that.

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions