Relative Content

Tag Archive for pythondjangodjango-queryset

Using difference() on Django model and then creating aggregation annotation

I have a Django app that imports data from a third-party source and allows me to map it to standardized data sets using a translation table. The translation table takes two values from the source data (manufacturer and model) and returns the model ID for the matching model in the standardized data. The reason for the translation table is that the model description isn’t 100% consistent in the source data, so I might need to map 2 or 3 model #s in the source data to a single model # in the standardized model table.