Is there a good reason why you can't add custom attributes to the inner Meta class of a Django model? The only one i can think of is to catch misconfigurations.
This thread shows how it can be worked around, but i'm wondering if there are any other reasons for this restriction.
Options, the class that processes Meta, and actually adds the _meta attribute to the model, runs through the attributes of Meta in a loop and uses setattr on itself to transfer the data. That process would fail if there's an attribute on Meta that doesn't exist on Options.
Now, there might be other reasons, but that's the only one I can glean from the source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With