On Thu, 2010-09-30 at 23:48 -0700, Gabriel Hurley 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?

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/

-- 
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.

Reply via email to