I have a legacy database, with a table that represents nodes in the filesystem. There are few types of nodes e.g. A, B, C and different types have different properties. In current database design there is one table that holds the information about a node. If the node is of type A then only fields relevant to the type A are set. Now I would like to express the types A, B, C as models. The problem that arises is:

  1. I would like to have such behaviour, all the three types have a name property. I would like to filter all the nodes in the filesystem by name property and get a list of objects of good types.

  2. Each node as a parent link, expressed as foreign key in the database, so probably some form of inheritance should take place.

Is it possible in django?

Edit
Report