Login

Snippets by tie

Snippet List

Custom optional abstract base attributes

I needed an abstract base class that can add attributes to the child classes based on the child's name. The attributes had to be implicit, but overridable, so all derived classes would get them by default, but they could be easily overriden in the child definition. So, the code code I came up with basically consists of a customized metaclass used by the abstract model.

  • model
  • abstract
Read More
Author: tie
  • 0
  • 2

tie has posted 1 snippet.