<commit_before>from django.db import models
import pickle

class RestModelBase(models.Model):
    "A base model which includes the ability to have a schema free extension field called rest"
    rest = models.TextField(verbose_name="JSON data.", default=pickle.dumps({}, 0),
                            help_text="Additional fields without fixed schema")

    def getRest(self):
        return pickle.loads(self.rest)

    def setRest(self, d):
        self.rest = pickle.dumps(d, 1)

    def asJSON(self):
        d = self.getRest()
        d.update(self.__dict__)<commit_msg>Add abstract attribute to RestModelBase.<commit_after>from django.db import models
import pickle

class RestModelBase(models.Model):
    "A base model which includes the ability to have a schema free extension field called rest"
    rest = models.TextField(verbose_name="JSON data.", default=pickle.dumps({}, 0),
                            help_text="Additional fields without fixed schema")

    class Meta:
        abstract = True

    def getRest(self):
        return pickle.loads(self.rest)

    def setRest(self, d):
        self.rest = pickle.dumps(d, 1)

    def asJSON(self):
        d = self.getRest()
        d.update(self.__dict__)
{'fraction_non_alphanumeric': 0.09754098360655737, 'fraction_numerical': 0.003278688524590164, 'mean_word_length': 2.839622641509434, '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': '3330790', 'n_tokens_mistral': 352, 'n_tokens_neox': 340, 'n_words': 105}