title: How to automatically choose model fields in django after calculation?
body: <pre><code>class Home(models.Model):
      home_type = models.CharField(max_length=255)
      home_square = models.PositiveIntegerField(default=0)
  
      def __str__(self):
          return self.home_type
  </code></pre>
  <blockquote>
  <p><strong>Example output :  Small home (type) = 60m2 (Home Square) // Medium home (type) = 90m2 (Home Square) // Big home (type) = 200m2 (Home
  Square)</strong></p>
  </blockquote>
  <pre><code>class Property(models.Model):
      name = models.CharField(max_length=255)
      width = models.PositiveIntegerField(default=0)
      length = models.PositiveIntegerField(default=0)
      property_type = models.ForeignKey(Box,null=True, blank=True, on_delete=models.CASCADE)
  
  
      def __str__(self):`
          return self.property_name
      
      @property
      def property_square(self):
          property_square = self.product_length * self.product_width
          return property_square
          
  </code></pre>
  <p>How can I assign a property type from Home model automatically to Property model according to property_square after calculation?</p>
  <p>if property_square &lt; 60 than choose property type from Home model as a Small Home.
  if property_square &gt;60 &lt;90 than choose property type from Home model as a Medium Home.</p>