how to get field type string from db model in django
问题 I am doing the following: model._meta.get_field('g').get_internal_type Which returns the following: <bound method URLField.get_internal_type of <django.db.models.fields.URLField: g>> I only want the know that this field is "URLField" . How do I extract that from this output? Note: I am doing this so that I can do validation on the fields. For example if a url , I want to check if it is well formed. 回答1: If you were doing this: model._meta.get_field('g').get_internal_type() You could not