Ejemplo n.º 1
0
class AsyncormMigrations(models.Model):
    app = models.CharField(max_length=75)
    name = models.CharField(max_length=75)
    applied = models.DateField(auto_now=True)

    class Meta():
        ordering = ('-id', )
        table_name = 'asyncorm_migrations'
Ejemplo n.º 2
0
class Book(models.Model):
    name = models.CharField(max_length=50)
    synopsis = models.CharField(max_length=255)
    book_type = models.CharField(max_length=15,
                                 null=True,
                                 choices=BOOK_CHOICES)
    pages = models.IntegerField(null=True)
    date_created = models.DateField(auto_now=True)
    author = models.ManyToManyField(foreign_key="Author")

    class Meta:
        ordering = ["-name"]
        unique_together = ["name", "synopsis"]
Ejemplo n.º 3
0
class Book(models.Model):
    name = models.CharField(max_length=50)
    synopsis = models.CharField(max_length=255)
    book_type = models.CharField(max_length=15,
                                 null=True,
                                 choices=BOOK_CHOICES)
    pages = models.IntegerField(null=True)
    date_created = models.DateField(auto_now=True)

    class Meta():
        ordering = [
            '-name',
        ]
        unique_together = ['name', 'synopsis']
Ejemplo n.º 4
0
class Book(models.Model):
    name = models.CharField(max_length=50)
    content = models.CharField(max_length=255, choices=BOOK_CHOICES)
    date_created = models.DateField(auto_now=True)
    author = models.ForeignKey(foreign_key="Author", null=True)
    price = models.DecimalField(default=25)
    quantity = models.IntegerField(default=1)

    @staticmethod
    def its_a_2():
        return 2

    class Meta:
        table_name = "library"
        ordering = ["-id"]
        unique_together = ["name", "content"]
Ejemplo n.º 5
0
class Book(models.Model):
    name = models.CharField(max_length=50)
    content = models.CharField(max_length=255, choices=BOOK_CHOICES)
    date_created = models.DateField(auto_now=True)
    author = models.ForeignKey(foreign_key='Author', null=True)
    price = models.DecimalField(default=25)
    quantity = models.IntegerField(default=1)

    def its_a_2(self):
        return 2

    class Meta():
        table_name = 'library'
        ordering = [
            '-id',
        ]
        unique_together = ['name', 'content']
Ejemplo n.º 6
0
class Appointment(models.Model):
    name = models.CharField(max_length=50)
    date = models.DateField()
Ejemplo n.º 7
0
class Appointment(models.Model):
    name = models.CharField(max_length=50)
    date = models.DateField()
    time = models.TimeField(null=True)
    uuid = models.Uuid4Field()