first commit
This commit is contained in:
@@ -16,11 +16,11 @@ class SensorData(models.Model):
|
||||
help_text="شناسه یکتای سنسور",
|
||||
)
|
||||
location = models.ForeignKey(
|
||||
"soil_data.SoilLocation",
|
||||
"location_data.SoilLocation",
|
||||
on_delete=models.CASCADE,
|
||||
related_name="sensor_data",
|
||||
db_column="location_id",
|
||||
help_text="همان location_id در soil_data",
|
||||
help_text="همان location_id از location_data",
|
||||
)
|
||||
soil_moisture = models.FloatField(null=True, blank=True, help_text="رطوبت خاک")
|
||||
soil_temperature = models.FloatField(null=True, blank=True, help_text="دما خاک")
|
||||
@@ -31,6 +31,12 @@ class SensorData(models.Model):
|
||||
nitrogen = models.FloatField(null=True, blank=True, help_text="ازت (N)")
|
||||
phosphorus = models.FloatField(null=True, blank=True, help_text="فسفر")
|
||||
potassium = models.FloatField(null=True, blank=True, help_text="پتاسیم")
|
||||
plants = models.ManyToManyField(
|
||||
"plant.Plant",
|
||||
blank=True,
|
||||
related_name="sensor_data",
|
||||
help_text="گیاهان مرتبط با این سنسور",
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
@@ -49,7 +55,7 @@ class SensorDataHistory(models.Model):
|
||||
"""
|
||||
|
||||
uuid_sensor = models.UUIDField(help_text="شناسه سنسور")
|
||||
location_id = models.IntegerField(help_text="location_id از soil_data")
|
||||
location_id = models.IntegerField(help_text="location_id از location_data")
|
||||
soil_moisture = models.FloatField(null=True, blank=True)
|
||||
soil_temperature = models.FloatField(null=True, blank=True)
|
||||
soil_ph = models.FloatField(null=True, blank=True)
|
||||
|
||||
Reference in New Issue
Block a user