Skip to content

Ordering does not work when overriding the META-class #29

Description

@donhauser

I've been searching quite a while to figure out why some of my models worked while others didn't.
By working I mean that you can see the dragging widget.

Finally I figured out that this problem comes from overriding the META class:

This code does not work:

from wagtailorderable.models import Orderable

class MyModel(Orderable):

    # Some fields, panels etc here

    class META:
         verbose_name_plural = "My Models"

This code does work:

from wagtailorderable.models import Orderable

class MyModel(Orderable):

    # Some fields, panels etc here

    # No META field

Extending META (instead of overriding) does work though, so this is probably the best option if you want to set verbose names etc.:

This code does work as well:

from wagtailorderable.models import Orderable

class MyModel(Orderable):

    # Some fields, panels etc here

    class META(Orderable.META): # note the inheritance here
         verbose_name_plural = "My Models"

In general I'm not sure, if this is a bug, I'd rather say this is unexpected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions