Answer the question
In order to leave comments, you need to log in
AttributeError: module 'django.forms.models' has no attribute 'Model'?
File "/Users/fromprog/Desktop/projects/students_votings_9b640/major_app/models.py", line 6, in
AttributeError: module 'django.forms.models' has no attribute 'Model'.
The code:
from django.db import models
from django.forms import *
class Texts(models.Model):
author = fields.CharField('Автор', max_length=50, default='######')
title = fields.CharField('Название', max_length=100)
topic = fields.CharField('Тема', max_length=100)
text = fields.TextField('Текст')
date = fields.DateTimeField('Дата и время публикации')
def __str__(self):
return self.title
class Meta:
verbose_name = 'Текст'
verbose_name_plural = 'Тексты'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question