unbound method contribute_to_class()
June 06, 08 bySymptom
A model does not validate with the following message:
Validating models... project.allication: Error when calling the metaclass bases unbound method contribute_to_class() must be called with TextField instance as first argument (got ModelBase instance instead) 1 error found.
Possible Cause
A model field was not declared properly, the parentheses after the field types name were missing:
wrong:
class Content(models.Model): content = models.TextField
correct:
class Content(models.Model): content = models.TextField()
Solution
A model field is an instance of the appropriate Field class, so the parentheses are required.