I can see why you might want control at the middleware level, but I'm not sure that's the only/best way to accomplish that goal, and it seems like the subject of a totally separate ticket to me. I'd rather see this set of redundant problems solved in a simple fashion rather than get into a debate over implementing a different feature...
just my two cents, - Gabriel On Oct 1, 1:13 am, "burc...@gmail.com" <burc...@gmail.com> wrote: > Hi Gabriel, everyone, > > I'd also like if such function can support option "developer provides > function that knows the current site based on the request". > That means, "get my site" function ultimately needs a backend connector! > > I think this might be fixed in the way we did with > urlconf:http://docs.djangoproject.com/en/dev/topics/http/urls/ > > So it will be taken from request: > request.site with default implementation to LazySite, with default > implementation of Site.objects.get_current() if sites_installed() or > RequestSite(request). > > That implementation would be overriden with middleware > > What do you think? > > > > > > On Fri, Oct 1, 2010 at 1:48 PM, Gabriel Hurley <gab...@gmail.com> wrote: > > I went to triage a few tickets tonight, and noticed that #8960, > > #10235, #10608 and #13814 have all arrived at essentially the same > > conclusion: there needs to be a single idiomatic way to get either the > > current Site object if contrib.sites is installed, or a RequestSite > > object if not. All four tickets use the same bit of code, the argument > > really only lies in where to put it. > > > #10235 adds it as a utility function in contrib.sites.models, #13814 > > as a separate method on SiteManager, and #8960 and #10608 basically > > just copy and paste where needed. I'm of the opinion it should have > > its own home in contrib.sites, but where, and under what name? > > > If we can agree on where this bit of code should live, I'd be happy to > > get all of these tickets fixed in one fell swoop. For reference, #8960 > > which has been bumped out of several releases now and is prime 1.3 > > material. > > > Suggestions? > > > All the best, > > > - Gabriel > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django developers" group. > > To post to this group, send email to django-develop...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-developers+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-developers?hl=en. > > -- > Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov, > MSN: bu...@live.com -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.