<commit_before># -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseBadRequest
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from rest_framework import serializers, viewsets
from rest_framework.decorators import detail_route
from shop.models.cart import BaseCart, BaseCartItem
from shop.models.product import BaseProduct
from shop.serializers.product import BaseProductSerializer


class CartItemSerializer(serializers.ModelSerializer):
    url = serializers.HyperlinkedIdentityField(lookup_field='pk', view_name='shop-api:cart-detail')
    line_subtotal = serializers.CharField(read_only=True)
    line_total = serializers.CharField(read_only=True)
    current_total = serializers.CharField(read_only=True)
    details = BaseProductSerializer(source='product', read_only=True)

    class Meta:
        model = getattr(BaseCartItem, 'MaterializedModel')
        exclude = ('cart', 'id',)

    CartModel = getattr(BaseCart, 'MaterializedModel')
    CartItemModel = getattr(BaseCartItem, 'MaterializedModel')
<commit_msg>removed dead code<commit_after># -*- coding: utf-8 -*-
from django.template import RequestContext
from rest_framework import serializers, viewsets
from rest_framework.decorators import detail_route
from shop.models.cart import BaseCart, BaseCartItem
from shop.models.product import BaseProduct
from shop.serializers.product import BaseProductSerializer


class CartItemSerializer(serializers.ModelSerializer):
    url = serializers.HyperlinkedIdentityField(lookup_field='pk', view_name='shop-api:cart-detail')
    line_subtotal = serializers.CharField(read_only=True)
    line_total = serializers.CharField(read_only=True)
    current_total = serializers.CharField(read_only=True)
    details = BaseProductSerializer(source='product', read_only=True)

    class Meta:
        model = getattr(BaseCartItem, 'MaterializedModel')
        exclude = ('cart', 'id',)

    CartModel = getattr(BaseCart, 'MaterializedModel')
    CartItemModel = getattr(BaseCartItem, 'MaterializedModel')

{'fraction_non_alphanumeric': 0.08685868586858686, 'fraction_numerical': 0.0022502250225022503, 'mean_word_length': 6.170967741935484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7615567', 'n_tokens_mistral': 610, 'n_tokens_neox': 598, 'n_words': 137}