If I have a class like:
class UpdateDocument(Document):
modified_date = DateTimeField()
meta = {'allow_inheritance': True}
def save(self, *args, **kwargs):
self.modified_date = datetime.utcnow()
return super(UpdateDocument, self).save(*args, **kwargs)
this won't work because if it's inherited by another document, it won't be able to save itself to its own class, like:
class New(UpdateDocument):
name = StringField()
when you save it, it'll be inserted into the database as an UpdateDocument. What's the workaround to generalize the save method. This is part of the issue of updating indexes as well, but I'm more concerned with just balancing class inheritance.