예제 #1
0
class Organization(models.Model):
    name = models.CharField(max_length=50)
    active = models.BooleanField(default=False)
    date = models.DateTimeField(null=True)
    uuid = models.Uuid4Field(uuid_type="v1", db_index=True)
예제 #2
0
    async def test_uuidv4field(self):
        with self.assertRaises(FieldError) as exc:
            models.Uuid4Field(uuid_type='mn')

        self.assertEqual(exc.exception.args[0], '{} is not a recognized type'.format('mn'))
예제 #3
0
class Appointment(models.Model):
    name = models.CharField(max_length=50)
    date = models.DateField()
    time = models.TimeField(null=True)
    uuid = models.Uuid4Field()
예제 #4
0
    async def test_uuidv4field(self):
        with self.assertRaises(AsyncOrmFieldError) as exc:
            models.Uuid4Field(uuid_type="mn")

        self.assertEqual(exc.exception.args[0],
                         "{} is not a recognized type".format("mn"))