<commit_before>from django.db import models
from ckeditor.fields import RichTextField

class Category(models.Model):
    category_parent = models.ForeignKey('self', blank=True, null=True, related_name='category_children')
    category_name = models.CharField('Name', max_length=50, blank=False, null=False)
    category_image = models.ImageField('Image', upload_to='category_images', blank=True)
    category_display_order = models.IntegerField('Display Order', default=999)
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        display_text = str(self.category_name)
        if self.category_parent:
            display_text = '{1} ({0})'.format(self.category_parent, self.category_name)
        return display_text
    
    class Meta:
        verbose_name_plural = 'Categories'
        verbose_name = 'Category'
        ordering = ['category_display_order', 'category_name']
    

class VehicleMake(models.Model):
    v_make = models.CharField('Make', max_length=50, blank=False, null=False)
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        return str(self.v_make)
    
    class Meta:
        verbose_name_plural = 'Makes'
        verbose_name = 'Make'


class Vehicle(models.Model):
    category = models.ForeignKey(Category)
    make = models.ForeignKey(VehicleMake)
    model = models.CharField('Model', max_length=100)
    year = models.IntegerField("Year (E.g. 1990)", blank=True, null=True)
    desc = RichTextField("Description")
    slug = models.SlugField()
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        display_text = '{0} {1} {2}'.format(self.make, self.model, self.year)
        return display_text
    

class VehicleImage(models.Model):
    vehicle = models.ForeignKey(Vehicle)
    image = models.ImageField('Image', upload_to='vehicle_images')
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        return '%s\'s Image' % self.vehicle
    
    class Meta:
        verbose_name_plural = 'Images'
        verbose_name = 'Image'<commit_msg>changed the way it gets the formatted string<commit_after>from django.db import models
from ckeditor.fields import RichTextField

class Category(models.Model):
    category_parent = models.ForeignKey('self', blank=True, null=True, related_name='category_children')
    category_name = models.CharField('Name', max_length=50, blank=False, null=False)
    category_image = models.ImageField('Image', upload_to='category_images', blank=True)
    category_display_order = models.IntegerField('Display Order', default=999)
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        display_text = str(self.category_name)
        if self.category_parent:
            display_text = '{1} ({0})'.format(self.category_parent, self.category_name)
        return display_text
    
    class Meta:
        verbose_name_plural = 'Categories'
        verbose_name = 'Category'
        ordering = ['category_display_order', 'category_name']
    

class VehicleMake(models.Model):
    v_make = models.CharField('Make', max_length=50, blank=False, null=False)
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        return str(self.v_make)
    
    class Meta:
        verbose_name_plural = 'Makes'
        verbose_name = 'Make'


class Vehicle(models.Model):
    category = models.ForeignKey(Category)
    make = models.ForeignKey(VehicleMake)
    model = models.CharField('Model', max_length=100)
    year = models.IntegerField("Year (E.g. 1990)", blank=True, null=True)
    desc = RichTextField("Description")
    slug = models.SlugField()
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        display_text = '{0} {1} {2}'.format(self.make, self.model, self.year)
        return display_text
    

class VehicleImage(models.Model):
    vehicle = models.ForeignKey(Vehicle)
    image = models.ImageField('Image', upload_to='vehicle_images')
    
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    
    def __unicode__(self):
        return "{0}'s Image".format(self.vehicle)
    
    class Meta:
        verbose_name_plural = 'Images'
        verbose_name = 'Image'
{'fraction_non_alphanumeric': 0.11038316458209252, 'fraction_numerical': 0.007742703990470518, 'mean_word_length': 3.862934362934363, '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': '3478026', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1531, 'n_words': 281}