Exemplo n.º 1
0
class Podcast(models.Model):
    Id = models.Integerfield(blank=False, null=False)
    Name = models.Charfield(max_length=100, null=False, blank=False)
    Duration = models.Decimalfield(max_digits=4, decimal_places=2, blank=False)
    Uploaded time = models.Integerfield(datetime.Datetime, blank=False)
    Host = models.Charfield(max_length=100, blank=False)
    Participants = models.Textfield(max_length=100, blank=True, end={''})
Exemplo n.º 2
0
class Audiobook(models.Model):
    Id = models.Integerfield(blank=False, null=False)
    Title = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Author = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Narrator = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Duration = models.Decimalfield(max_digits=4, decimal_places=2, blank=False)
    Uploaded time = models.Integerfield(datetime.Datetime, blank=False)


    def __str__(self):
        return self.name
Exemplo n.º 3
0
class Payments(models.Model):
    PAYMENT_TYPES = (
        ('gocardless', 'Go Cardless'),
        ('barclays', 'Barclays Bank Transfer'),
        ('coop', 'Co-Op Bank Transfer'),
        ('cash', 'Cash to board member'),
    )

    member = models.ForeignKey('user_auth.Member', on_delete=models.CASCADE)
    source = models.CharField(choices=PAYMENT_TYPES,
                              default='gocardless',
                              max_length=2)
    amount = models.Decimalfield(max_digits=8, decimal_places=2)
    reference = models.CharField(max_length=20)
    date = models.DateField(auto_now_add=True)
Exemplo n.º 4
0
class Insurance(models.Model):

    # "riskType" represents the type of risk the insurer is taking. Automobiles, houses, prizes etc.
    # "fieldName" reprsents the name of data the insurer would like to keep track of.
    # "fieldData" reprsents the actual data the insurer would like to keep track of.
    # "fieldType" represents the data type of the given field. text, number, date, or enum.

    #EXAMPLES
    #riskType=automobile, fieldName=model, fieldData=Ford Fiesta, fieldType=text
    #                   , fieldName=monthly payment, fieldData=$400/mo, fieldType=number
    #                   ,...
    #                   ,...
    #                   ,...

    #riskType=golf tournament, fieldName=first prize, fieldData=$100,000, fieldType=number
    #                        , fieldName=second prize, fieldData=$50,000, fieldType=number
    #                        ,...
    #                        ,...
    #                        ,...
    fieldTypeChoices = (("False", "False"), ("text", "text"),
                        ("number", "number"), ("date", "date"))
    enumChoices = (("False", "False"), ("Bronze", "Bronze"),
                   ("Silver", "Silver"), ("Gold", "Gold"))
    #this could be changed to a dependent choice map. IE if user selects enum as data type then and only then allow an enumChoice selection
    #but for the purposes of this project I believe true/false should suffice.

    riskType = models.CharField(max_length=100)
    fieldName = models.CharField(max_length=100)
    fieldData = models.CharField(max_length=1000)
    fieldType = models.CharField(max_length=100,
                                 choices=fieldTypeChoices,
                                 default="False")
    enumType = models.CharField(max_length=100,
                                choices=enumChoices,
                                default="False")

    if (fieldType == 'date'):
        fieldData = models.Datefield
    if (fieldType == 'number'):
        fieldData == models.Decimalfield(max_digits=19, decimal_places=10)

    def __str__(self):
        return self.riskType
Exemplo n.º 5
0
class Song(models.Model):
    Id = models.Integerfield(blank=False, null=False)
    Name = models.Charfield(max_length=100, null=False, blank=False)
    Duration = models.Decimalfield(max_digits=4, decimal_places=2, blank=False)
    Uploaded time = models.Integerfield(datetime.Datetime, blank=False)