def get_context(self, request, category, slug, year, month, day, id):
        try:
            cat = Category.objects.get_by_tree_path(category)
        except Category.DoesNotExist:
            # non-static url, no way to recover
            if year:
                raise Http404("Category with tree_path '%s' doesn't exist." % category)
            else:
                cat = None

        if year:
            start_date = localize(datetime(int(year), int(month), int(day)))
            end_date = start_date + timedelta(days=1)

            lookup = {
                'publish_from__gte': start_date,
                'publish_from__lt': end_date,
                'category': cat,
                'slug': slug,
                'static': False
            }
            try:
                publishable = get_cached_object(Publishable, published=True, **lookup)
            except Publishable.DoesNotExist:
                # Fallback for staff members in case there are multiple
                # objects with same URL.
                if request.user.is_staff:
                    try:
                        # Make sure we return specific publishable subclass
                        # like when using `get_cached_object` if possible.
                        p = Publishable.objects.filter(published=False, **lookup)[0]
                        publishable = p.content_type.model_class()._default_manager.get(pk=p.pk)
                    except IndexError:
                        raise Http404
                else:
                    raise Http404
        else:
            publishable = get_cached_object_or_404(Publishable, pk=id)

        if not (publishable.is_published() or request.user.is_staff):
            # future publish, render if accessed by logged in staff member
            raise Http404

        if not year:
            if cat is None:
                raise self.WrongUrl('Category with tree_path %r does not exist.' % category, publishable)
            elif not publishable.static:
                raise self.WrongUrl(publishable % '%s is not static.', publishable)
            elif slug != publishable.slug:
                raise self.WrongUrl('Wrong slug in URL (%r).' % slug, publishable)
            elif publishable.category_id != cat.pk:
                raise self.WrongUrl('Wrong category for %s.' % publishable, publishable)

        # save existing object to preserve memory and SQL
        publishable.category = cat

        context = {
            'object': publishable,
            'category': cat,
            'content_type_name': slugify(publishable.content_type.model_class()._meta.verbose_name_plural),
            'content_type': publishable.content_type
        }

        return context
dataset/ETHPy150Open ella/ella/ella/core/views.py/ObjectDetail.get_context/swapped operands of `%`