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?
> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>
--
Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov,
MSN: bu...@live.com
I think a stand-alone function in contrib.sites.models is fine, called
`get_current_site` (or some other sensible colour of your choosing).
Since both Site and RequestSite already live there, it seems a good
place.
Thanks for your work on this,
Luke
--
"Despair: It's always darkest just before it goes pitch black."
(despair.com)
Luke Plant || http://lukeplant.me.uk/
Absolutely right, go ahead with your patch. If someone really cares
about the other feature (which seems a bit obscure to me), then they
will do the normal things required.
Thanks,
Luke
--
"DO NOT DISTURB. I'm disturbed enough already."
Luke Plant || http://lukeplant.me.uk/
looking good!
--