Answer the question
In order to leave comments, you need to log in
How to perform a call from the field of an object to the fields of several other objects?
I have a question. How to access from the start_point and end_point of the Pipeline model to 3 objects (Factory, OilSump, OilStorage) to the address fields
class Factory(models.Model):
title = models.CharField(max_length=200)
address = YmapCoord(max_length=200, start_query=u'Россия', size_width=500, size_height=500, unique = True)
def __str__(self):
return self.title
class OilSump(models.Model):
title = models.CharField(max_length=200)
address = YmapCoord(max_length=200, start_query=u'Россия', size_width=500, size_height=500, unique = True)
def __str__(self):
return self.title
class OilStorage(models.Model):
title = models.CharField(max_length=200)
address = YmapCoord(max_length=200, start_query=u'Россия', size_width=500, size_height=500, unique = True)
def __str__(self):
return self.title
class Pipeline(models.Model):
title = models.CharField(max_length=200)
start_point = ????
end_point = ????
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