Reputation: 17067
I thought this question would have already existed on SO, but then I couldn't find any.
I am trying to find a reasonable place to define a constant associated with Item, a self-defined django model. This constant needs to be accessible to instances of Item, as well as beyond the model class. My basic idea is to defined it as a class attribute for Item, but I am not sure how to do that for django model class. My intuition tells me to define it in the model's metadata, if doable. Is that the right way to do it?
Upvotes: 0
Views: 248