I have a Django project whereby every model inherits from a common “Object” model – which defines only two fields – the ID of the object (so every object in the entire system has a unique identifier) and a “type”. The type is the type of object that particular instance is. This is a sort of “denormalized” field, making it faster to travel down the tree from Object to Person, for example.
Basically I have a field in one of the inherited models, which has the same name as another class that inherits from Object – that means that the field for travelling down the relationship is overridden.
I just wondered if anyone else has had a similar experience, and whether there are any rather elegant ways of solving it – other than just renaming the field in the inherited model.
Maybe renaming would be appropriate. If one of your fields has the same identifier as a class, you may break some naming conventions (although, of course these are only conventions).
See PEP 8, section Naming Conventions.