PynamoDB
                                
                                
                                
                                    PynamoDB copied to clipboard
                            
                            
                            
                        Adding support for abstract inheritance in Pynamo
Changes are described in https://github.com/pynamodb/PynamoDB/issues/439
I had a thought with what might be an alternate approach (though you all might have already considered and rejected this):
Given that we already have AttributeContainer as a base class for inheriting MapAttributes, and that a Model already extends it, do we perhaps already have a form of abstract inheritance already and we simply need to document / codify the rules around it?
SharedAttributes(AttributeContainer):
    foo = StringAttribute(hash_key=True)
MyModelWithBar(Model, SharedAttributes):
    # inherits foo from SharedAttributes
    bar = NumberAttribute()
MyModelWithBaz(Model, SharedAttribtues):
    # inherits foo from SharedAttributes
    baz = NumberAttribtue()
                                    
                                    
                                    
                                
How is this PR going?
@garrettheel Can you review it please?
@jpinner-lyft @garrettheel any chance we can inherit from pynamodb.models.Model in a BaseModel that we can inherit from in all our custom models? That way it would be possible to write functionality in tandem with Model functionality. For example, right now if I want to write some code for the save function before doing super(...).save() I have to do it for every model and that is not very DRY. Any chance that this is supported in any way?
The abstract class implementation in the PR above sounds like a good solution for my use case. I already tried just doing it with pynamodb out of the box but receive an error about the constructor not getting the right arguments. Any ideas or suggestions?