Skip to content

AppMixin documentation needs some touch up #5046

@afkiwers

Description

@afkiwers

Body of the issue

I would like to add a model to my plugin but in doing so, Inventree complains.

I tried using the normal app structure but without any success. Is there any way to add some more elaborated sample than the sample.py or extend the docs?

class TestPlugin(InvenTreePlugin, AppMixin):
    AUTHOR = "Author"

    DESCRIPTION = "Test app"

    VERSION = PLUGIN_VERSION

    NAME = "Test Plugin"class TestPlugin(InvenTreePlugin, AppMixin):
    AUTHOR = "Author"

    DESCRIPTION = "Test app"

    VERSION = PLUGIN_VERSION

    NAME = "Test Plugin"
    SLUG = "testapp"
    TITLE = "Test Plugin"
    PUBLISH_DATE = datetime.date(2023, 6, 9)
    WEBSITE = "https://www.test.com"

    MIN_VERSION = '0.11.0'

Model:

 class EnabledCategory(models.Model):
        category = models.ForeignKey(PartCategory, related_name='get_all', on_delete=models.CASCADE)

Error Message:
Model class testapp.testapp.EnabledCategory doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions