
#定义类的两种方式 #问:对象是由类创建?类是由Type创建。 #方式一: class Foo(object): class Meta: model = 'asdf' #方式二: _meta = type('Meta',(object,),{'model':'asdf'}) Foo = type('Foo',(object,),{'Meta':_meta}) # ModelForm # # # class Foo(ModelForm): # class Meta: # model = models.UserInfo # _xx # xxx # xxx # # xxx