On Sun, 2006-07-02 at 00:54 -0700, Ahmad Alhashemi wrote: > Hi Luke, > > I agree that explicitness is better. But I think implicit filtering > here is not that bad for two reasons. The first is, as I said, it is > the rule not the exception. The second is that it makes it extremely > easy to start your application as a single site application then turn > it into a multi-site application. > > In all the other solutions, a lot of view code has to be changed when > you decide to turn a single site application into a multi-site one. > > Besides, I think of this feature more as DRY than as implicit parameter > setting. It is in a way similar to authentication code. You don't have > to repeat authentication code in every view becasue authentication is > the rule not the exception. > > The same way, you don't have to add code to tell the view that the > table contains records for many weblogs and we are only interested in > one weblog at a time. You will almost never run a query without > specifying the weblog_id because the weblogs are completely seperate, > and as I said before, you can almost put each weblog's data in its own > database, but you don't want to do that.
To avoid going round and round in circles here with a lack of specifics, maybe you could suggest how you see this kind of API working. What would be added where to configure this type of filtering? And how will a request know what the right value to filter on would be? I am struggling to see how you can do this without tying views to models. I think you are going to have to pass in some kind of identifying information from your view to indicate the filtering parameter's value. And that level of parameterisation can already be done with customer manager methods. You are always going to have to specify the weblog_id (or whatever condition you are filtering on) somewhere and you are going to have to put in some logic somewhere to convert a request into the right weblog_id. The latter can be done by request context processors, so there's no repetition there, either. Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
