So, I have two models:
class ProductQualityMonitor(models.Model):
product_name = models.CharField(..)
area = models.CharField(...))
timeslot = models.DateTimeField(...)
def get_measured_parameters(self):
(...)
class QualityParameter(models.Model):
PARAMETER_CHOICES = (
(MEAN, MEAN),
(MEDIAN, MEDIAN),
(MAXIMUM, MAXIMUM),
(MINIMUM, MINIMUM),
)
name = models.CharField(max_length=50, choices=PARAMETER_CHOICES)
value = models.FloatField()
product = models.ForeignKey(ProductQualityMonitor,
related_name="parameters")
I need to get statistics about quality parameters. I have a method that receives some attributes, such as a date range, and aggregates ten statistics for each parameter, and finally returns a json object with all the statistics.
I doubt: can I call this method by passing the parameters that the method needs in the URL and see the results? And, if possible, how can I do this?
Sorry if my explanation is a bit messy, I'm new to Django.
source
share