<commit_before>from django.db import models
from django.contrib.auth.models import User

# First four models will be moved to a 'userprofiles' app

class UserType(models.Model):
    """A model for storing the type of user, such as construction business,
    home owner, salvage company, recycling company etc. This allows for
    certain features of our app to be targeted to specific kinds of users."""
    user_type = models.CharField(max_length=128)

    def __str__(self):
        return self.user_type

class Profile(models.Model):
    """A model for storing data related to specific users."""
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    user_type = models.ForeignKey(UserType)
    company = models.CharField(max_length=128)

    def __str__(self):
        return self.user.username

class ProjectType(models.Model):
    """A model for storing categories of construction projects such as
    new construction, commercial construction, residential construction,
    remodel, home owner project etc."""
    project_type = models.CharField(max_length=128)

    def __str__(self):
        return self.project_type

class Project(models.Model):
    """A model for storing a specific construction project, registered
    by a user along with its associated data."""
    profile = models.ForeignKey(Profile, related_name='projects')
    project = models.CharField(max_length=128)
    project_type = models.ForeignKey(ProjectType)
    address = models.CharField(max_length=128)

    def __str__(self):
        return self.project

# Models for the 'wasteprocessors' app

class MaterialType(models.Model):
    """A model for storing broad categories of building materials such as
    wood, brick, concrete, reusable building materials etc."""
    material_type = models.CharField(max_length=128)
    description = models.TextField(blank=True)
    special_considerations = models.TextField(blank=True)

    def __str__(self):
        return self.material_type

class Material(models.Model):
    """A model for storing specific types of building materials such
    as pressure treated lumber, cedar shingles, reusable kitchen cabinets
    etc."""
    material = models.CharField(max_length=128)
    material_type = models.ForeignKey(MaterialType)
    description = models.TextField(blank=True)
    special_considerations = models.TextField(blank=True)

    def __str__(self):
        return self.material

class WasteType(models.Model):
    """A model for storing various categories of construction waste such
    as salvage, scrap, surplus etc."""
    waste_type = models.CharField(max_length=128) # salvage, scrap, surplus etc.

    def __str__(self):
        return self.waste_type

class Waste(models.Model):
    """A specific waste item generated by a contractor or home owner that
    they wish to recycle, sell or donate for reuse."""
    project = models.ForeignKey(Project)
    waste_type = models.ForeignKey(WasteType)
    material = models.ForeignKey(Material)

    def __str__(self):
        return self.description

class WasteProcessor(models.Model):
    """A model for storing data related to a specific construction waste
    processing business or service."""
    company = models.CharField(max_length=128)
    description = models.TextField(blank=True)
    website = models.URLField(blank=True)
    phone = models.CharField(max_length=15, blank=True)
    business_hours = models.TextField(blank=True)
    email = models.EmailField(blank=True)
    address = models.CharField(max_length=128, blank=True)
    materials_accepted = models.ManyToManyField(MaterialType, related_name='material_types')
    will_pick_up = models.BooleanField()
    will_purchase = models.BooleanField()
    accepts_donations = models.BooleanField()

    def __str__(self):
        return self.company
<commit_msg>changed material to material type on Waste model -- decide if you need Material model at all.<commit_after>from django.db import models
from django.contrib.auth.models import User

# First four models will be moved to a 'userprofiles' app

class UserType(models.Model):
    """A model for storing the type of user, such as construction business,
    home owner, salvage company, recycling company etc. This allows for
    certain features of our app to be targeted to specific kinds of users."""
    user_type = models.CharField(max_length=128)

    def __str__(self):
        return self.user_type

class Profile(models.Model):
    """A model for storing data related to specific users."""
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    user_type = models.ForeignKey(UserType)
    company = models.CharField(max_length=128)

    def __str__(self):
        return self.user.username

class ProjectType(models.Model):
    """A model for storing categories of construction projects such as
    new construction, commercial construction, residential construction,
    remodel, home owner project etc."""
    project_type = models.CharField(max_length=128)

    def __str__(self):
        return self.project_type

class Project(models.Model):
    """A model for storing a specific construction project, registered
    by a user along with its associated data."""
    profile = models.ForeignKey(Profile, related_name='projects')
    project = models.CharField(max_length=128)
    project_type = models.ForeignKey(ProjectType)
    address = models.CharField(max_length=128)

    def __str__(self):
        return self.project

# Models for the 'wasteprocessors' app

class MaterialType(models.Model):
    """A model for storing broad categories of building materials such as
    wood, brick, concrete, reusable building materials etc."""
    material_type = models.CharField(max_length=128)
    description = models.TextField(blank=True)
    special_considerations = models.TextField(blank=True)

    def __str__(self):
        return self.material_type

class Material(models.Model):
    """A model for storing specific types of building materials such
    as pressure treated lumber, cedar shingles, reusable kitchen cabinets
    etc."""
    material = models.CharField(max_length=128)
    material_type = models.ForeignKey(MaterialType)
    description = models.TextField(blank=True)
    special_considerations = models.TextField(blank=True)

    def __str__(self):
        return self.material

class WasteType(models.Model):
    """A model for storing various categories of construction waste such
    as salvage, scrap, surplus etc."""
    waste_type = models.CharField(max_length=128) # salvage, scrap, surplus etc.

    def __str__(self):
        return self.waste_type

class Waste(models.Model):
    """A specific waste item generated by a contractor or home owner that
    they wish to recycle, sell or donate for reuse."""
    project = models.ForeignKey(Project)
    waste_type = models.ForeignKey(WasteType)
    material_type = models.ForeignKey(MaterialType)

    def __str__(self):
        return self.description

class WasteProcessor(models.Model):
    """A model for storing data related to a specific construction waste
    processing business or service."""
    company = models.CharField(max_length=128)
    description = models.TextField(blank=True)
    website = models.URLField(blank=True)
    phone = models.CharField(max_length=15, blank=True)
    business_hours = models.TextField(blank=True)
    email = models.EmailField(blank=True)
    address = models.CharField(max_length=128, blank=True)
    materials_accepted = models.ManyToManyField(MaterialType, related_name='material_types')
    will_pick_up = models.BooleanField()
    will_purchase = models.BooleanField()
    accepts_donations = models.BooleanField()

    def __str__(self):
        return self.company

{'fraction_non_alphanumeric': 0.0854336306061781, 'fraction_numerical': 0.008271940028434795, 'mean_word_length': 4.084099868593955, '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': '7627978', 'n_tokens_mistral': 2161, 'n_tokens_neox': 2043, 'n_words': 653}