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

from sales.models import Sale

class Ride(models.Model):
    name           = models.CharField(max_length = '255')
    slug           = models.CharField(max_length = '255', unique = True)
    description    = models.TextField(blank = True)
    start_location = models.CharField(max_length = '255')
    end_location   = models.CharField(max_length = '255')
    start_date     = models.DateField()
    end_date       = models.DateField()

    # Details to sign up riders
    rider_capacity = models.IntegerField(default = 0)
    price          = models.IntegerField(default = 0)

    # Linked Entities
    chapter        = models.ForeignKey('chapters.Chapter', null=True, blank=True)
    riders         = models.ManyToManyField(User, through='RideRiders', null=True, blank=True)

    class Meta:
        db_table    = 'rides'
        app_label   = 'rides'


class RideRiders(models.Model):
    user = models.ForeignKey(User)
    ride = models.ForeignKey(Ride)

    # Other information we might want to know about a user signing up to a ride
    signup_date = models.DateTimeField()
    pending     = models.BooleanField() # is the spot reserved for them before paying?
    paid        = models.BooleanField() # have they completed payment for the ride?
    sale        = models.ForeignKey(Sale, blank=True, null=True) # what is the sale that this transaction happened through?

    class Meta:
        db_table    = 'rides_riders'
        app_label   = 'rides'<commit_msg>Given the signup date field in the RideRiders model a default datetime of now.<commit_after>from datetime import datetime
from django.db import models
from django.contrib.auth.models import User

from sales.models import Sale

class Ride(models.Model):
    name           = models.CharField(max_length = '255')
    slug           = models.CharField(max_length = '255', unique = True)
    description    = models.TextField(blank = True)
    start_location = models.CharField(max_length = '255')
    end_location   = models.CharField(max_length = '255')
    start_date     = models.DateField()
    end_date       = models.DateField()

    # Details to sign up riders
    rider_capacity = models.IntegerField(default = 0)
    price          = models.IntegerField(default = 0)

    # Linked Entities
    chapter        = models.ForeignKey('chapters.Chapter', null=True, blank=True)
    riders         = models.ManyToManyField(User, through='RideRiders', null=True, blank=True)

    class Meta:
        db_table    = 'rides'
        app_label   = 'rides'


class RideRiders(models.Model):
    user = models.ForeignKey(User)
    ride = models.ForeignKey(Ride)

    # Other information we might want to know about a user signing up to a ride
    signup_date = models.DateTimeField(default=datetime.now())
    pending     = models.BooleanField() # is the spot reserved for them before paying?
    paid        = models.BooleanField() # have they completed payment for the ride?
    sale        = models.ForeignKey(Sale, blank=True, null=True) # what is the sale that this transaction happened through?

    class Meta:
        db_table    = 'rides_riders'
        app_label   = 'rides'
{'fraction_non_alphanumeric': 0.08995363214837712, 'fraction_numerical': 0.00865533230293663, 'mean_word_length': 2.9559902200489, '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': '6388023', 'n_tokens_mistral': 950, 'n_tokens_neox': 915, 'n_words': 264}