Answer the question
In order to leave comments, you need to log in
Django how to solve form problem?
I have two models
class City(models.Model):
name = models.CharField('City', max_length=50)
temperature = models.ForeignKey('Temperature', blank=True, null=True, on_delete=models.CASCADE)
def __str__(self):
return self.name
class Meta:
verbose_name_plural = 'Cities'
class Temperature(models.Model):
temperature = models.IntegerField('Temperature')
def __str__(self):
return str(self.temperature)
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