<commit_before>from django.db import models


class Category(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):
        return self.name


class Product(models.Model):
    name = models.CharField(max_length=100)
    price = models.DecimalField(max_digits=6, decimal_places=2)
    category = models.ForeignKey(Category)<commit_msg>[add] New transaction models<commit_after>from django.db import models


class Category(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):
        return self.name


class Product(models.Model):
    name = models.CharField(max_length=100)
    price = models.DecimalField(max_digits=6, decimal_places=2)
    category = models.ForeignKey(Category)


class Transaction(models.Model):
    user = models.ForeignKey("users.User")
    when = models.DateTimeField(auto_now_add=True)

    class Meta:
        abstract = True


class TransferTransaction(Transaction):
    user = models.ForeignKey("users.User", related_name="outgoing_transfers")
    receiver = models.ForeignKey("users.User", related_name="incoming_transfers")
    amount = models.DecimalField(max_digits=6, decimal_places=2)


class TopupTransaction(Transaction):
    amount = models.DecimalField(max_digits=6, decimal_places=2)


class ProductTransaction(Transaction):
    product = models.ForeignKey("stock.Product")


class MiscTransaction(Transaction):
    info = models.TextField()
{'fraction_non_alphanumeric': 0.10639777468706536, 'fraction_numerical': 0.013908205841446454, 'mean_word_length': 4.873469387755102, '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': '5126364', 'n_tokens_mistral': 442, 'n_tokens_neox': 416, 'n_words': 78}