0

How can I design an Entity Management system in Django which can be able to adapt to any kind of entity with minimal code changes (e.g. a product in a catalog, patient information in healthcare etc.).

  1. Adding, removing, modifying the attributes of an entity should be simple
  2. It should allow for nested attributes (sub-entities) e.g Patient -> Consulting doctor
  3. Each attribute or sub-entity in the entity can have a set of business rules

1 Answers1

1

Sounds like you have the need for a rather standard django app. I would follow their tutorial in order to grasp django and get you started.

In regards to your questions, I've quoted parts and given links to how you can achieve this:

  1. "Adding" (CreateView), "removing" (DeleteView), "modifying the attributes"(UpdateView) of an entity should be simple
  2. It should allow for "nested attributes" (models.ForeignKey) (sub-entities) e.g Patient -> Consulting doctor
  3. Each attribute or sub-entity in the entity can have a set of business rules. (create a 'controller' and call it in overiden methods, this SO answer answers where to put it perfectly)

Your requirements pretty much define what django does.

Stefan Collier
  • 4,314
  • 2
  • 23
  • 33