pyo: fix weird merge default tip
authorYury Yurevich <the.pythy@gmail.com>
Fri Apr 10 22:35:22 2009 +0700 (2 weeks ago)
changeset 1407aa293baae06b
parent 14067fccdb9918e8
pyo: fix weird merge
apps/blog/views.py
       1 --- a/apps/blog/views.py	Fri Apr 10 22:15:39 2009 +0700
       2 +++ b/apps/blog/views.py	Fri Apr 10 22:35:22 2009 +0700
       3 @@ -31,13 +31,6 @@
       4      except (ValueError, TypeError):
       5          return None
       6  
       7 -
       8 -def _get_date(date_str):
       9 -    try:
      10 -        return d(*time.strptime(date_str, '%Y%m%d')[:3])
      11 -    except ValueError:
      12 -        raise Http404
      13 -
      14  def _spammers_must_die(request, extra_msg="PyO: not spam"):
      15      msg = """\
      16  Spammers, go home
      17 @@ -107,9 +100,11 @@
      18  @render_to('blog/post_detail.html')
      19  def post_detail(request, year, month, day, slug):
      20      reply_to = _get_reply_to(request)
      21 -    date = _get_date(year+month+day)
      22 -    today = (dt.combine(date, t.min), dt.combine(date, t.max))
      23 -    post = get_object_or_404(Post.all_objects.filter(date__range=today), slug=slug)
      24 +    year, month, day = int(year), int(month), int(day)
      25 +    post = get_object_or_404(Post.all_objects, slug=slug,
      26 +                             date__year=year,
      27 +                             date__month=month,
      28 +                             date__day=day)
      29      if post.comments_open():
      30          try:
      31              Form = request.user.is_authenticated() and CommentForm or AnonymousCommentForm