App design with Django and a reporting app -


i have 4 applicatiosn in 1 django site:

  1. people app
  2. car app
  3. holiday app
  4. report app

i want produce reports/charts app 1,2,3 question this...

1) stick having report views in each app /people/report, car/report

or

2) should put in report app report/car, report/people etc.

the problem option 2 have lot of model importing, meaning never independent.

in case see 3 options:

  1. has advantage it's easier change behaviour specific chart. i'm guessing people might have different types of chart cars.

  2. could made independent using generic foreign keys (or that).

  3. create separate report app automatically scans other apps charts.py app (or similar) django models.py. way can keep specific chart configuration in app contains it's model.

    the generic report app contain base class extend , override specific apps.

my vote go option 3 since offers best both worlds. although might bit more complicated started, increases reusability.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -