Answer the question
In order to leave comments, you need to log in
Why is there an error when migrating to Django?
Created a model
from django.db import models
from django.contrib.postgres.fields import ArrayField
class VKGROUPREQUESTS(models.Model):
id_group = models.CharField(max_length=100)
count_posts = models.IntegerField(default=0)
date_time_request = models.DateField(auto_now_add=True)
file_path = models.CharField(max_length=256, blank=True)
data = ArrayField(models.CharField(max_length=200), blank=True)
def __str_(self):
return self.id_group
class Meta:
ordering = ['id_group']
verbose_name = 'Запрос'
verbose_name_plural = 'Запросы'
class VKGROUP(models.Model):
id_group = models.ForeignKey(VKGROUPREQUESTS, on_delete=models.CASCADE)
@property
def __str__(self):
return self.id_group
class Meta:
ordering = ['id_group']
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