'Returns the question that the URL represents.
If the question doesn\'t exist or the URL isn\'t a question URL,
this returns None.
If id_only is requested, we just return the question id and
we don\'t validate the existence of the question (this saves us
from making a million or so db calls).'

@classmethod
def from_url(cls, url, id_only=False):

    parsed = urlparse(url)
    (locale, path) = split_path(parsed.path)
    path = ('/' + path)
    try:
        (view, view_args, view_kwargs) = resolve(path)
    except Http404:
        return None
    import kitsune.questions.views
    if (view != kitsune.questions.views.question_details):
        return None
    question_id = view_kwargs['question_id']
    if id_only:
        return int(question_id)
    try:
        question = cls.objects.get(id=question_id)
    except cls.DoesNotExist:
        return None
    return question
