Skip to content

Use get_class for oscar_invoice.utils.InvoiceCreator #14

@specialunderwear

Description

@specialunderwear

Currently overriding oscar_invoice.utils.InvoiceCreator is non trivial because it is not loaded with get_class. The only way to make this possible is to add one more namespace to the application. Let's say we add a namespace called 'poepie' making the folder structure like this:

oscar_invoices/poepie/utils.py

that would allow using get_class like this:

InvoiceCreator = get_class("poepie.utils", "Invoice_creator", "oscar_invoices")

You can not use get_class with only 2 namespace levels, you CAN however use get_model (it is implemented completely different).

Please suggest the 3rd namespace name and I will create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions