Example #1
0
    def has_field(cls, model: models.Model, field_name: str):
        """
        Check if the model has the column with specified name.
        :param model:
        :param field_name:
        :return:
        """
        for f in model._meta.fields:
            if Str.eq(f.name, field_name):
                return True

        return False
Example #2
0
    def test_str(self):
        self.assertEqual(Str.casefold('ViỆt Nam'), Str.casefold('việt nam'))

        self.assertTrue(Str.eq('a', 'A'))
        self.assertFalse(Str.eq('a', 'A', case=True))