Answer the question
In order to leave comments, you need to log in
How to create such models?
I have the following structure:
class Profile(models.Model):
name = models.CharField(max_length=128)
class Characteristic(models.Model):
name = models.CharField(max_length=128)
class ProfileCharacteristic(models.Model):
profile = models.ForeignKey('profiles.Profile', on_delete=models.CASCADE, related_name='profile_characteristics')
characteristic = models.ForeignKey('characteristic.Characteristic', on_delete=models.CASCADE, related_name='profile_characteristics')
# следующие поля я б хотел упростить/изменить
value_text = models.TextField(null=True)
value_number = models.FloatField(null=True)
value_range = ArrayField(models.FloatField(), size=2, null=True)
value_list = ArrayField(models.CharField(max_length=128), null=true)
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