I just have a few practical ideas that I want to lay out, pertaining to loose coupling.
I've worked with Django for a while and one of the things I love is that you can do things your own way, instead of having the constricting requirements that "convention over configuration" brings (like in Rails). Django does enlists a few "convention" requirements if you want to make things easy and automatic. This is fine unless you need to do it the non-automatic way (larger applications bring this need up). There are a few areas where this comes up but I'll only touch on the most obvious: When you're building an application that has many related data models and different types of users that have many views which access data from multiple apps, it becomes really easy to forget where you put certain models and seems disorganized. Splitting things up into more and more apps doesn't fix the problem, because having apps that only serve as a host for views and apps that only serve as a host for models makes a mess in larger applications. What does fix the problem is keeping a taxonomy that makes sense for your business; data models based on where they belong and views based on who/what they're for (e.g. data models in ``project/data/company/ models.py``, views that access those models in ``project/views/clients/ tickets.py`` and ``project/views/company/dashboard.py``). My proposal (This solution could be way off but I'm really wanting to hear what others think about the problem in general): Create a way to manually register a model instead of simply scanning for models.py in each installed app. The current ``"myapp.MyModel"`` way of accessing models for foreign keys could be replaced with model naming much the same way that views can be named. Being able to name your models and accessing them by name seems better anyways because then your class name could change but the models "name" would remain the same, making code changes easier. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
