On Tuesday, 15 May 2018 12:21:26 UTC+1, Anton Smirnov wrote:
>
> I have two models: "Sensors" with information about its and "Measurments" .
>
> class Sensor(models.Model):
> date_start = models.DateField()
> Latitude = models.DecimalField(max_digits=18, decimal_places=15)
> Longitude
When you are using models related by a Foreign Key, by default you have
access to the "children" models from the parent model. For example, your
Sensor model gets a "measurment_set" property just because of such foreign
key:
>>> dir(Sensor.objects.all()[0])
>
> [other properties,
There are two models "Sensors" with information about them and
"Measurments" .
class Sensor(models.Model):
date_start = models.DateField()
Latitude = models.DecimalField(max_digits=18, decimal_places=15)
Longitude = models.DecimalField(max_digits=18, decimal_places=15)
def
I have two models: "Sensors" with information about its and "Measurments" .
class Sensor(models.Model):
date_start = models.DateField()
Latitude = models.DecimalField(max_digits=18, decimal_places=15)
Longitude = models.DecimalField(max_digits=18, decimal_places=15)
def
4 matches
Mail list logo