When will the attribute error occur...?

Asked 2 years ago, Updated 2 years ago, 49 views

I keep getting errors while copying programmers' Janggo class, but I don't know where it went wrong. https://programmers.co.kr/learn/courses/6/lessons/470

https://programmers.co.kr/learn/courses/6/lessons/468

from django.db import models

# # Create your models here.



class Candidate(models.Model):
    name = models.CharField(max_length=10)
    introduction = models.Textfield()
    area = models.CharField(max_length=15)
    party_number = models.IntegerField(defalut=0)
 File "C:\Users\yeonm\mysite\elections\models.py", line 9, in Candidate
    introduction = models.Textfield()
AttributeError: module 'django.db.models' has no attribute 'Textfield'
PS C:\Users\yeonm\mysite>


django python

2022-09-22 08:13

1 Answers

It's a typo. Textfield() -> TextField()

AttributeError: module 'django.db.models' has no attribute 'Textfield' is the description of the error.


2022-09-22 08:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.