<commit_before>from rest_framework import serializers
from django.forms import widgets


class ListingSerializer(serializers.Serializer):
    id = serializers.Field()
    title = serializers.CharField(required=False, max_length=100)
    description = serializers.CharField(widget=widgets.Textarea, max_length=1000)
    absolute_url = serializers.URLField(required=False)
    price = serializers.SerializerMethodField('get_price')
    currency = serializers.SerializerMethodField('get_currency')
    address = serializers.CharField(required=False, max_length=255)
    type = serializers.CharField(required=False, max_length=30)
    offer = serializers.CharField(required=False, max_length=10)
    active = serializers.BooleanField(required=False)
    baths = serializers.IntegerField(required=False)
    beds = serializers.IntegerField(required=False)
    size = serializers.FloatField(required=False)
    coords = serializers.CharField(required=False, max_length=255)
    agent = serializers.CharField(required=False, max_length=100)
    created_at = serializers.CharField(required=False, max_length=100)
    last_modified = serializers.CharField(required=False, max_length=100)
    images = serializers.SerializerMethodField('get_images')

    def get_images(self, listing):
        return listing.image_list

    def get_price(self, listing):
        return listing.price.amount

    def get_currency(self, listing):
        return listing.price.currency<commit_msg>Removed widget argument since it's not supported in REST Framework 3<commit_after>from rest_framework import serializers


class ListingSerializer(serializers.Serializer):
    id = serializers.Field()
    title = serializers.CharField(required=False, max_length=100)
    description = serializers.CharField(max_length=1000)
    absolute_url = serializers.URLField(required=False)
    price = serializers.SerializerMethodField('get_price')
    currency = serializers.SerializerMethodField('get_currency')
    address = serializers.CharField(required=False, max_length=255)
    type = serializers.CharField(required=False, max_length=30)
    offer = serializers.CharField(required=False, max_length=10)
    active = serializers.BooleanField(required=False)
    baths = serializers.IntegerField(required=False)
    beds = serializers.IntegerField(required=False)
    size = serializers.FloatField(required=False)
    coords = serializers.CharField(required=False, max_length=255)
    agent = serializers.CharField(required=False, max_length=100)
    created_at = serializers.CharField(required=False, max_length=100)
    last_modified = serializers.CharField(required=False, max_length=100)
    images = serializers.SerializerMethodField('get_images')

    def get_images(self, listing):
        return listing.image_list

    def get_price(self, listing):
        return listing.price.amount

    def get_currency(self, listing):
        return listing.price.currency
{'fraction_non_alphanumeric': 0.09171496760995568, 'fraction_numerical': 0.018070235254006136, 'mean_word_length': 5.434210526315789, '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': '6693099', 'n_tokens_mistral': 859, 'n_tokens_neox': 813, 'n_words': 144}